VBE syntax line question

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
 
B

Bob Phillips

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)
 
R

RADO

Oops. Thanks, Bob - I meant Range("H2")... Sorry.. programmed all night
long, can't think straight.
Best -

RADO
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top