VBE syntax line question

  • Thread starter Thread starter Colette
  • Start date Start date
C

Colette

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
 
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)
 
Oops. Thanks, Bob - I meant Range("H2")... Sorry.. programmed all night
long, can't think straight.
Best -

RADO
 
Back
Top