Macro- Column Insert

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After recording a macro that inserts a column in a worksheet, I run it and it
inserts two columns. I don't understand why?
 
lostatlewisu said:
After recording a macro that inserts a column in a worksheet, I run it and it
inserts two columns. I don't understand why?

Sub Problem()
'
' Problem Macro
' Macro recorded 8/16/2007
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Columns("E:H").Select
Selection.Delete Shift:=xlToLeft
Columns("G:G").Select
Range("G2").Activate
Selection.Insert Shift:=xlToRight
Range("G2").Select
ActiveCell.FormulaR1C1 = "new one"
With ActiveCell.Characters(Start:=1, Length:=7).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("G3").Select
End Sub
 
Hi Dave,
I don't know. I just know that when I clicked (while recording the macro)
th tool bar button for merge and center, the columns were ungrouped and the
marco only inserted one column on the playback. ;0)
 
Back
Top