View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default how to create a macro that references the currently active cell

Give this a whirl...

Sub Insert5Columns()
ActiveCell.Offset(0, 1).Resize(, 5).EntireColumn.Insert
End Sub
--
HTH...

Jim Thomlinson


"Kurt" wrote:

I would like to create a macro that will insert 5 columns to the right of the
currently active cell. I would like to select any cell in my worksheet and
run the macro and have it insert 5 columns. Any ideas?