visual basic - select/activate but don't show sheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm trying to make a nice user interface on one worksheet. When I access
cells in other worksheets using select or activate, the view automatically
switches to the other worksheet. Is there any way for me to get the values
in cells on other sheets, but keep the view on my one user interface
worksheet?
Thanks in advance for any help.
Donna
 
You (almost) never need to Activate or Select anything in Excel/VBA. Just
reference the cell directly:

Dim V As Variant
V = Worksheets("SomeSheet").Range("A10").Value
Worksheets("SomeOtherSheet").Range("B20").Value = V

or, as a one liner

Worksheets("SomeOtherSheet").Range("B20").Value = _
Worksheets("SomeSheet").Range("A10").Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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