Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I write the syntax in my macro using VBE to
perform this: I need to create a variable named "OldStock" and set it equal to the value of cell H2 Any help would be great. thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim OldStock
OldStock=Cells("H2").Value Best, RADO "Colette" wrote in message ... How do I write the syntax in my macro using VBE to perform this: I need to create a variable named "OldStock" and set it equal to the value of cell H2 Any help would be great. thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
RADO,
I don't think you can use Cells in this way. You could use OldStock = Cells(2,"H").Value or OldStock = Cells(2, ,8).Value or OldStock = Range("H2").Value or even OldSTock = Range("A1").Cells(2,"H").Value or variations on the same, but not Cells("H2"). -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "RADO" wrote in message ... Dim OldStock OldStock=Cells("H2").Value Best, RADO "Colette" wrote in message ... How do I write the syntax in my macro using VBE to perform this: I need to create a variable named "OldStock" and set it equal to the value of cell H2 Any help would be great. thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops. Thanks, Bob - I meant Range("H2")... Sorry.. programmed all night
long, can't think straight. Best - RADO "Bob Phillips" wrote in message ... RADO, I don't think you can use Cells in this way. You could use OldStock = Cells(2,"H").Value or OldStock = Cells(2, ,8).Value or OldStock = Range("H2").Value or even OldSTock = Range("A1").Cells(2,"H").Value or variations on the same, but not Cells("H2"). -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "RADO" wrote in message ... Dim OldStock OldStock=Cells("H2").Value Best, RADO "Colette" wrote in message ... How do I write the syntax in my macro using VBE to perform this: I need to create a variable named "OldStock" and set it equal to the value of cell H2 Any help would be great. thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax question | Excel Worksheet Functions | |||
VBA syntax question | Excel Discussion (Misc queries) | |||
syntax question | Excel Worksheet Functions | |||
VBA Syntax Question? | Excel Programming | |||
VBA Row(line) No Syntax? | Excel Programming |