Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel select a cell in another sheet

Status
Not open for further replies.

JulesPaul

Technical User
Oct 11, 2011
3
AU
Hi,

If I understand you correctly you will need the following:
Dim wks as worksheet
set wks = Worksheets("insert sheet name in these quotes")
Sheets(wks.Name).Select ' This changes to the named worksheet
Range("A1").Select ' This sets the focus to cell A1. Can have ("A") & row) where row is a variable. All depends upon your code.

If you just want to obtain a value then use
wks.Cells(Row, Col).value

Cheers
 



Do you ACTUALLY need to Select the cell???
Code:
with YourSheetObject
   .Activate
   .YourCellObject.Select
end with
or do you just need to reference this cell???
Code:
with YourSheetObject.YourCellObject

end with




Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If possible avoid using select or activate in your code. It is much easier on the eyes because of screen flicker going away and its usually faster and more stable.

For example you can say

If Worksheets("Data").Cells(i, "F").Interior.Color = 65535 Then GoTo A

and it won't matter what sheet you are looking at it will get the information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top