Problem cuz of Hidden sheet

H

helmekki

Hi there

The sheet 2 should the activesheet, cuz the sheet1,where my data, i
hidden.

i need to select the row in the sheet1 where my found result (r) exis
in, so i used this line:


Code
-------------------
ThisWorkbook.Sheets(1).Cells(r, 1).EntireRow.Select
-------------------


but it gives me wrong msg: Select method of Range class Failed.

How can select the row without having to activate the sheet1


Code
-------------------

Sub t()
Dim r, o As Long

r = ThisWorkbook.Sheets(1).Cells.Find(What:=1).Row
ThisWorkbook.Sheets(1).Cells(r, 1).EntireRow.Select

End Sub
-------------------
 
C

Chip Pearson

You can't select cells on a hidden sheet. But that really
shouldn't matter because it is hardly ever necessary to select a
cell. Use a Range object variable instead.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"helmekki"
message
news:[email protected]...
 

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