ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro reference to a specific cell on a different worksheet (https://www.excelbanter.com/excel-programming/432389-macro-reference-specific-cell-different-worksheet.html)

Nickis

Macro reference to a specific cell on a different worksheet
 
I am looking up text in a table. I have the following code that works if the
text in the active cell matches the text in A1.

How can I modify this code so that the A1 range being referenced is on a
different worksheet. I'm sure this is pretty simple, but I can't get it
right.

If ActiveCell.Text = Range("a1").Text Then
ActiveCell.Select

Thanks, Nicki

Jacob Skaria

Macro reference to a specific cell on a different worksheet
 
If ActiveCell.Text = Worksheets("Sheet1").Range("a1").Text Then
ActiveCell.Select
End If

If this post helps click Yes
---------------
Jacob Skaria


"Nickis" wrote:

I am looking up text in a table. I have the following code that works if the
text in the active cell matches the text in A1.

How can I modify this code so that the A1 range being referenced is on a
different worksheet. I'm sure this is pretty simple, but I can't get it
right.

If ActiveCell.Text = Range("a1").Text Then
ActiveCell.Select

Thanks, Nicki


Nickis

Macro reference to a specific cell on a different worksheet
 
Thank You!

"Jacob Skaria" wrote:

If ActiveCell.Text = Worksheets("Sheet1").Range("a1").Text Then
ActiveCell.Select
End If

If this post helps click Yes
---------------
Jacob Skaria


"Nickis" wrote:

I am looking up text in a table. I have the following code that works if the
text in the active cell matches the text in A1.

How can I modify this code so that the A1 range being referenced is on a
different worksheet. I'm sure this is pretty simple, but I can't get it
right.

If ActiveCell.Text = Range("a1").Text Then
ActiveCell.Select

Thanks, Nicki



All times are GMT +1. The time now is 10:44 PM.

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