PDA

View Full Version : Can this macro be simplified?



dilipramadas
03-10-2011, 08:42 AM
Sub Format()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+y
'
Range("U9:U19").Select
Selection.Copy
Range("W9:W19").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("S9:S19").Select
Selection.Copy
Range("U9:U19").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Columns("W:X").Select
Selection.Columns.Ungroup
Range("W9").Select
End Sub

Bob Phillips
03-10-2011, 08:48 AM
Sub Format()
Range("U9:U19").Copy
Range("W9:W19").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("S9:S19").Copy
Range("U9:U19").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Columns("W:X").Columns.Ungroup
Range("W9").Select
End Sub