|
-
Jun 5th, 2003, 06:47 AM
#1
Thread Starter
PowerPoster
Excel VBA simple one *RESOLVED*
in an Excel VBA macro, I have the statement
Range("D44").Value = n2
which works fine until I add a row, at which time the "D44" reference REMAINS "D44" even though the cell I'm targeting has moved down one row.
So, my question is, is there some way to tie VBA code to cells in a way that lets them track the cells as they do when they are referenced by formulas? That is, if a FORUMLA used "D44" and I added a row, the formula would then use "D45", which is what I want my VBA to do.
Thanks for any help.
Last edited by phinds; Jun 5th, 2003 at 07:09 AM.
-
Jun 5th, 2003, 07:01 AM
#2
One way could be to assign to targetcell a name and use this name to call it instead of "D44"
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Jun 5th, 2003, 07:08 AM
#3
Thread Starter
PowerPoster
JUST what I was looking for --- thanks opus
-
Jun 5th, 2003, 07:47 AM
#4
Great, I could help somebody today, that make this "working"day a success.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|