ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy active cell value,find the pasted value in different worksheet (https://www.excelbanter.com/excel-worksheet-functions/98016-copy-active-cell-value-find-pasted-value-different-worksheet.html)

[email protected]

copy active cell value,find the pasted value in different worksheet
 
hi,

I am trying to put together a simple macro to do the following job - so
far I haven't succeeded:

copy active cell value,go to the first worksheet in my spreadsheet,
find the pasted value in there and select the row where it has found
the value.

can anyone help?

Thx.

Tom


Bernie Deitrick

copy active cell value,find the pasted value in different worksheet
 
Tom,

Sub TomFind()
Dim myVal As Variant
On Error GoTo NotFound
myVal = ActiveCell.Value
Worksheets(1).Activate
Cells.Find(myVal).EntireRow.Select
Exit Sub

NotFound:
MsgBox "That value wasn't found on Worksheet 1"
End Sub

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi,

I am trying to put together a simple macro to do the following job - so
far I haven't succeeded:

copy active cell value,go to the first worksheet in my spreadsheet,
find the pasted value in there and select the row where it has found
the value.

can anyone help?

Thx.

Tom




[email protected]

copy active cell value,find the pasted value in different worksheet
 
Bernie,

thanks a lot.

it does the job perfectly and at the same time it's very short and
simple macro.

Cheers.

Tom

Bernie Deitrick wrote:
Tom,

Sub TomFind()
Dim myVal As Variant
On Error GoTo NotFound
myVal = ActiveCell.Value
Worksheets(1).Activate
Cells.Find(myVal).EntireRow.Select
Exit Sub

NotFound:
MsgBox "That value wasn't found on Worksheet 1"
End Sub

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi,

I am trying to put together a simple macro to do the following job - so
far I haven't succeeded:

copy active cell value,go to the first worksheet in my spreadsheet,
find the pasted value in there and select the row where it has found
the value.

can anyone help?

Thx.

Tom




All times are GMT +1. The time now is 03:54 AM.

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