jasonb75
Well-known Member
- Joined
- Dec 30, 2008
- Messages
- 15,509
- Office Version
- 365
- Platform
- Windows
Hi all
This is a follow on to http://www.mrexcel.com/forum/showthread.php?t=369569
The original problem has now been solved and the macro is fully working, but it has a limitation that I want to try and remove.
To do this I need to do something which I don't think will be possible, but I'm sure somebody will prove me wrong.
The macro is dynamic, based on an offset from the active cell when the macro is initialized.
This means it's not practical to define a variable for each possible cell that it could run from, but that's what I need.
Ideal solution is for the marco to write its own code
Directly after Sub mysub()
and directly before End Sub
This would work on the basis of 1 if the macro runs in row 1
if it runs in row 2 then it would be oldrow2 = 2 etc
Any ideas or possible solutions, or have I finally beaten everyone?
Thanks
Jason
This is a follow on to http://www.mrexcel.com/forum/showthread.php?t=369569
The original problem has now been solved and the macro is fully working, but it has a limitation that I want to try and remove.
To do this I need to do something which I don't think will be possible, but I'm sure somebody will prove me wrong.
The macro is dynamic, based on an offset from the active cell when the macro is initialized.
This means it's not practical to define a variable for each possible cell that it could run from, but that's what I need.
Ideal solution is for the marco to write its own code
Directly after Sub mysub()
Code:
Static oldrow1 as integer
Code:
oldrow1 = 1
This would work on the basis of 1 if the macro runs in row 1
if it runs in row 2 then it would be oldrow2 = 2 etc
Any ideas or possible solutions, or have I finally beaten everyone?
Thanks
Jason