Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Allocating a value to a VBA variable from a worksheet.
I have a line in a VBA program that I am writing that reads as
follows: For i = 26 to 35 next i and that, of coarse, works perfectly.... but now I want to extract the values in "E6" and "F6" on the current worksheet and place them respectively in place of the 26 and the 35. I know this is dead easy, but for the life of me, I just can't get my mind around it. Any help greatly appreciated. Geoff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Allocating a value to a VBA variable from a worksheet.
Geoff
Like this Dim i as Long For i = ActiveSheet.Range("E6") To ActiveSheet.Range("f6") Next i Mike "Geoff E" wrote: I have a line in a VBA program that I am writing that reads as follows: For i = 26 to 35 next i and that, of coarse, works perfectly.... but now I want to extract the values in "E6" and "F6" on the current worksheet and place them respectively in place of the 26 and the 35. I know this is dead easy, but for the life of me, I just can't get my mind around it. Any help greatly appreciated. Geoff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Allocating a value to a VBA variable from a worksheet.
For i = Sheets("test").Range("E6") To Sheets("test").Range("F6")
If it is the active sheet For i = Range("E6") To Range("F6") If this post helps click Yes --------------- Jacob Skaria "Geoff E" wrote: I have a line in a VBA program that I am writing that reads as follows: For i = 26 to 35 next i and that, of coarse, works perfectly.... but now I want to extract the values in "E6" and "F6" on the current worksheet and place them respectively in place of the 26 and the 35. I know this is dead easy, but for the life of me, I just can't get my mind around it. Any help greatly appreciated. Geoff |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Allocating a value to a VBA variable from a worksheet.
Thank you Jacob and Mike.
They both worked like a dream. Much too embarrassed to tell you what the problem was. Too long behind this computer and tired as a result. I think I need to get a life. Geoff On Sep 6, 11:14*pm, Jacob Skaria wrote: For i = Sheets("test").Range("E6") To Sheets("test").Range("F6") If it is the active sheet For i = Range("E6") To Range("F6") If this post helps click Yes --------------- Jacob Skaria "Geoff E" wrote: I have a line in a VBA program that I am writing that reads as follows: For i = 26 to 35 next i and that, of coarse, works perfectly.... but now I want to extract the values in "E6" and "F6" on the current worksheet and place them respectively in place of the 26 and the 35. I know this is dead easy, but for the life of me, I just can't get my mind around it. Any help greatly appreciated. Geoff- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
allocating numbers to cells | Excel Worksheet Functions | |||
Allocating percentages | Excel Discussion (Misc queries) | |||
Allocating remainders | Excel Worksheet Functions | |||
Allocating a value from a cell | Excel Worksheet Functions | |||
Allocating a Value | Excel Worksheet Functions |