Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get a macro to start in the right spot!

I have a few macros that I use to input predetermined numbers in cells.

ie:
Sub testmacro()
Range("A3").Select
ActiveCell.FormulaR1C1 = "25"
Range("A4").Select
ActiveCell.FormulaR1C1 = "10"
Range("A5").Select
ActiveCell.FormulaR1C1 = "2"
Range("A6").Select
ActiveCell.FormulaR1C1 = "4"
Range("A7").Select
End Sub

The problem is that if a row is inserted above A3 then I want the macr
to start at A4. In other words I want it to start in the same relativ
cell.

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get a macro to start in the right spot!

You could give a name to each of your target cell, and that name woul
remain with the cell wherever it goes as a result of insertions, etc.
You can name your ranges in Excel by doing InsertNameDefine, or yo
can simply select your target cell, type a range name in the Name bo
near the top left of the worksheet screen and (required) press Enter.

billy

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get a macro to start in the right spot!

Thank

--
Message posted from http://www.ExcelForum.com

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
X marks the spot BlueFeather Excel Discussion (Misc queries) 2 December 11th 08 11:18 AM
Hosur an IT hot spot? [email protected] Excel Worksheet Functions 0 October 17th 07 03:47 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
I want a name in one spot and it's code in another TwoWheelDemon Excel Discussion (Misc queries) 1 March 17th 05 04:31 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 08:37 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"