Muy buenas tardes a todos, tengo una macro que entre otras cosas copia
celdas discontinuas y las pega en la fila superior, la tengo creada
así:
Private Sub CommandButton1_Click()
Range("C10").Select
Selection.Copy
Range("C9").Select
ActiveSheet.Paste
Range("G10").Select
Selection.Copy
Range("G9").Select
ActiveSheet.Paste
Range("I10").Select
Selection.Copy
Range("I9").Select
ActiveSheet.Paste
Range("K10").Select
Selection.Copy
Range("K9").Select
ActiveSheet.Paste
Range("O10:P10").Select
Selection.Copy
Range("O9:P9").Select
ActiveSheet.Paste
Range("A9").Select
Selection.EntireRow.Insert
Rows("10:10").Select
Selection.Copy
Rows("9:9").Select
Selection.PasteSpecial Paste:=xlPasteFormats
Range("A10").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
ComboBox1 = Empty
ComboBox2 = Empty
ComboBox1.SetFocus
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowFiltering:=True
Range("A9").Select
Sheets("MENU").Select
ActiveWorkbook.Save
End
End Sub
Y mi pregunta es ¿se puede reducir de alguna forma los códigos de
copiar/pegar en esta macro?
Muchísimas gracias por vuestra atención
Un saludo
Cecilia
Leer las respuestas