VB question for 2 sheets

  • Thread starter Thread starter eluehmann
  • Start date Start date
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
 
variable1 = Worksheets("Sheet1").Range("A3").Value

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
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
 

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

Back
Top