Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable string and loops
I am missing something fundamental here, but I am new to this..
It should be returning the Row No. every 7th but only returns 7, 7, 7... Dim HderRows(1 To 5) As String Range("B3").Select For n = 1 To 5 HderRows(n) = ActiveCell.Offset(7, 0).Row Next n Also, an 'operational' question, is there a quick way to reset a sub while de-bugging? The highlighted error tends remain even after a fix. Again, probably missed something easy here Thanks M. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable string and loops
That's because you aren't changing the active cell. You don't need to select
or activate a cell to work with it. I'm not sure what values you want to put in your array, but if it's just a series of number that increment by 7 each time: R = 7 For n = 1 To 5 HderRows(n) = R R = R + 7 Next n Note that if the series happens to be row numbers, that doesn't matter. There's no reason to access the worksheet here. On Wed, 27 Oct 2004 13:05:05 -0700, "Mourinho" wrote: I am missing something fundamental here, but I am new to this.. It should be returning the Row No. every 7th but only returns 7, 7, 7... Dim HderRows(1 To 5) As String Range("B3").Select For n = 1 To 5 HderRows(n) = ActiveCell.Offset(7, 0).Row Next n Also, an 'operational' question, is there a quick way to reset a sub while de-bugging? The highlighted error tends remain even after a fix. Again, probably missed something easy here Thanks M. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
variable string and loops
Forgot your other question: Maybe Run/Reset is what you are after.
On Wed, 27 Oct 2004 13:05:05 -0700, "Mourinho" wrote: I am missing something fundamental here, but I am new to this.. It should be returning the Row No. every 7th but only returns 7, 7, 7... Dim HderRows(1 To 5) As String Range("B3").Select For n = 1 To 5 HderRows(n) = ActiveCell.Offset(7, 0).Row Next n Also, an 'operational' question, is there a quick way to reset a sub while de-bugging? The highlighted error tends remain even after a fix. Again, probably missed something easy here Thanks M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use a string as a Variable Name | Excel Worksheet Functions | |||
Variable in string | Excel Discussion (Misc queries) | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
How do I convert an integer variable to a string variable? | Excel Programming | |||
Join string with variable name to get variable value | Excel Programming |