Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default how to create a macro that references the currently active cell

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default how to create a macro that references the currently active cell

Activecell.Offset(0,1).Resize(1,5).EntireColumn.In sert

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Kurt" wrote in message
...
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?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
How do I create an excel macro to append to a cell with existing i zola_tiara Excel Discussion (Misc queries) 4 September 14th 05 08:22 PM
How do I create a macro, that references another excel file ??? Aries Excel Worksheet Functions 1 May 25th 05 11:37 AM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"