Excel 2013 macro - in ACTIVECELL.OFFSET (1, 0).SELECT how do I specify the number of rows to offset from a value (say $S$4 = 6) in my spreadsheet?
Asked
Active
Viewed 1,719 times
0
-
1Don't use activecell, use the desired cell? – findwindow Feb 25 '16 at 21:38
2 Answers
1
First to answer your question:
ACTIVECELL.OFFSET (ActiveSheet.Range("S4"), 0).SELECT
But you should avoid the .SELECT
See THIS POST on how to do that.
the method you are choosing is problematic, as it will slow the code

Community
- 1
- 1

Scott Craner
- 148,073
- 10
- 49
- 81
-
-
That worked, thanks. I left in .select as after reading the "post" it would not concern me. I tried this solution first. However it exposed a logic error (unrelated to your solution) and that will be a thorny one to fix. What I'm trying to do is update a specific row (X) in a list by copying and pasting the revised data X lines down from the top. – jgb Feb 25 '16 at 23:13
-
That is a new question. In a new post ask your question. You will want to show some data and more of the code. @jgb – Scott Craner Feb 25 '16 at 23:20
-
I was just commenting, not asking a 2nd question. I fixed the logic bug, so this macro now works like I want. Thanks again @ScottCraner – jgb Feb 26 '16 at 15:43
-
I am glad it works, please mark as correct, by clicking on the gray/green check mark by the answer. @jgb – Scott Craner Feb 26 '16 at 15:55
0
To retrieve the value in a cell and use it as the offset you can use something like:
ACTIVECELL.OFFSET (sheet1.range("s4").value, 0).select

ninjaRoche
- 62
- 1
- 6