Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba variable value via cell reference
I do not know the proper syntax
for the fourth line of this sample code. 1. Dim S as Long 2. Dim X as Long 3. For X = 5 To 55 4. S = Range("G&'X'&") 5. Next x Please change my gloomy day to a bright shining wonder. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba variable value via cell reference
S = Range("G" & X)
"Bill (Unique as my name)" wrote in message oups.com... I do not know the proper syntax for the fourth line of this sample code. 1. Dim S as Long 2. Dim X as Long 3. For X = 5 To 55 4. S = Range("G&'X'&") 5. Next x Please change my gloomy day to a bright shining wonder. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba variable value via cell reference
Thanks Bob!
Bob Phillips wrote: S = Range("G" & X) "Bill (Unique as my name)" wrote in message oups.com... I do not know the proper syntax for the fourth line of this sample code. 1. Dim S as Long 2. Dim X as Long 3. For X = 5 To 55 4. S = Range("G&'X'&") 5. Next x Please change my gloomy day to a bright shining wonder. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba variable value via cell reference
for the fourth line of this sample code.
4. S = Range("G&'X'&") If I understand correctly, perhaps one of these ideas: Sub Demo() Dim S As Long Dim X As Long For X = 5 To 55 S = Range("G" & X) Next X End Sub 'Or perhaps to avoid using strings... Sub Demo2() Dim S As Long Dim R As Long '(R)ow For R = 5 To 55 S = Cells(R, 7) Next R End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "Bill (Unique as my name)" wrote in message oups.com... I do not know the proper syntax for the fourth line of this sample code. 1. Dim S as Long 2. Dim X as Long 3. For X = 5 To 55 4. S = Range("G&'X'&") 5. Next x Please change my gloomy day to a bright shining wonder. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Lookup Data in two seperate Spreadsheets | Excel Worksheet Functions | |||
Urgent date/scheduling calc needed | Excel Worksheet Functions | |||
Cell Reference Math | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |