VB question for 2 sheets

E

eluehmann

I am writing VB code for Sheet 2 and I need to get a value from sheet
to use. How do I do this? I know I am being vague but I really do no
know how to explain. I assume:

Dim variable1 as string

sub GetValue()
Here is where I need to pick up a value from sheet 1 cell A3 an
make equal to variable1 and do stuff to it
end su
 
B

Bob Phillips

variable1 = Worksheets("Sheet1").Range("A3").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
S

SOS

eluehmann,

I just put the following code in a module and I could get the value o
variable1:

Sub Test()
Dim variable1
variable1 = ActiveWorkbook.Sheets("Sheet1").Range("A3").Value
End Sub

HTH

Seamu
 
Top