resizing a range

  • Thread starter Thread starter tim mcphillips
  • Start date Start date
T

tim mcphillips

I can't the following code to work. I am trying to resize
a range so I can insert columns.

Sub ResizeIT()
Dim range1 As Range
Dim range2 As Range
Set range1 = Worksheets("UnitTemplate").Range("CS7")
Set range2 = range1
Worksheets("UnitTemplate").Range("range1").Resize(0,
3).Select
Selection.EntireColumn.Insert
End Sub

Any help would be appreciated!
 
Try this:

Sub ResizeIT()

'Inserts 3 columns into worksheet at cell CS7

Worksheets("Sheet1").Range("CS7").Activate
Selection.Resize(1, 3).Select
Selection.EntireColumn.Insert

End Sub


HTH

Michael J. Malinsky
 
As for why the present code doesn't work, you can't resize to 0 rows (or 0 columns). Does it
work if you change the 0 to a 1?
 
Back
Top