ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Find on nonactive sheet (https://www.excelbanter.com/excel-programming/396379-using-find-nonactive-sheet.html)

Bonsai Bill

Using Find on nonactive sheet
 
I have two sheets, Roster and Skills. Both sheets have a name column that is
identical. I want to pull data from the Skills sheet and put on Roster sheet.

The following code works:

Sheets("Skills").Activate
Columns(1).Find(Name).Activate
iName = ActiveCell.Row

But the following doesn't:

Sheets("Roster").Activate
With Sheets("Skills")
.Columns(1).Find(Name).Activate
iName = .ActiveCell.Row
End With

I get an "Activate method of range class failed" error. How can I use FInd
on a non active sheet?

Thanks for any help on this!

Don Guillett

Using Find on nonactive sheet
 
try

IName=Sheets("Skills").Columns(1).Find(Name).row



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bonsai Bill" wrote in message
...
I have two sheets, Roster and Skills. Both sheets have a name column that
is
identical. I want to pull data from the Skills sheet and put on Roster
sheet.

The following code works:

Sheets("Skills").Activate
Columns(1).Find(Name).Activate
iName = ActiveCell.Row

But the following doesn't:

Sheets("Roster").Activate
With Sheets("Skills")
.Columns(1).Find(Name).Activate
iName = .ActiveCell.Row
End With

I get an "Activate method of range class failed" error. How can I use FInd
on a non active sheet?

Thanks for any help on this!



Bonsai Bill

Using Find on nonactive sheet
 
Thanks Don. That works great! This one goes into my collection of tips.

I have other things to do on the nonactive sheet that work fine using the
With.

"Don Guillett" wrote:

try

IName=Sheets("Skills").Columns(1).Find(Name).row



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bonsai Bill" wrote in message
...
I have two sheets, Roster and Skills. Both sheets have a name column that
is
identical. I want to pull data from the Skills sheet and put on Roster
sheet.

The following code works:

Sheets("Skills").Activate
Columns(1).Find(Name).Activate
iName = ActiveCell.Row

But the following doesn't:

Sheets("Roster").Activate
With Sheets("Skills")
.Columns(1).Find(Name).Activate
iName = .ActiveCell.Row
End With

I get an "Activate method of range class failed" error. How can I use FInd
on a non active sheet?

Thanks for any help on this!




Don Guillett

Using Find on nonactive sheet
 
with Sheets("Skills")
iname=.Columns(1).Find(Name).row
end with

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bonsai Bill" wrote in message
...
Thanks Don. That works great! This one goes into my collection of tips.

I have other things to do on the nonactive sheet that work fine using the
With.

"Don Guillett" wrote:

try

IName=Sheets("Skills").Columns(1).Find(Name).row



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bonsai Bill" wrote in message
...
I have two sheets, Roster and Skills. Both sheets have a name column
that
is
identical. I want to pull data from the Skills sheet and put on Roster
sheet.

The following code works:

Sheets("Skills").Activate
Columns(1).Find(Name).Activate
iName = ActiveCell.Row

But the following doesn't:

Sheets("Roster").Activate
With Sheets("Skills")
.Columns(1).Find(Name).Activate
iName = .ActiveCell.Row
End With

I get an "Activate method of range class failed" error. How can I use
FInd
on a non active sheet?

Thanks for any help on this!






All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com