Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Can I use variables in a Range function?
I´m triyng to use a variable content in a Range function without success,
Example: LINHAREF = 10 Do While LINHAREF < 40 Lk = "K" + Str(LINHAREF) MsgBox Range(Lk) LINHAREF = LINHAREF +1 Loop |
#2
|
|||
|
|||
You've DIMmed LINHAREF as an Integer, right?
Change it to: Lk = "K" & LINHAREF Works for me. "André - Brazil" wrote: I´m triyng to use a variable content in a Range function without success, Example: LINHAREF = 10 Do While LINHAREF < 40 Lk = "K" + Str(LINHAREF) MsgBox Range(Lk) LINHAREF = LINHAREF +1 Loop |
#3
|
|||
|
|||
You can also use cells().
LINHAREF = 10 Do While LINHAREF < 40 MsgBox cells(linharef,"K").value LINHAREF = LINHAREF +1 Loop André - Brazil wrote: I´m triyng to use a variable content in a Range function without success, Example: LINHAREF = 10 Do While LINHAREF < 40 Lk = "K" + Str(LINHAREF) MsgBox Range(Lk) LINHAREF = LINHAREF +1 Loop -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing a range name as an argument to the Index Function | Excel Discussion (Misc queries) | |||
clock | Excel Worksheet Functions | |||
Function to determine if any cell in a range is contained in a given cell | Excel Worksheet Functions | |||
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function | Excel Worksheet Functions | |||
Formula to list unique values | Excel Worksheet Functions |