ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Cells on two worksheets (https://www.excelbanter.com/excel-programming/384497-selecting-cells-two-worksheets.html)

stewdizzle

Selecting Cells on two worksheets
 
In my workbook i have VB code to select a specific cell based on
specific criteria. How can I select the corresponding cell on another
worksheet. For example I want to find cell A4 on Sheet 1 and select
both that cell and Cell A4 on Sheet2


Mark Dullingham

Selecting Cells on two worksheets
 
Try this
Sheets(Array("Sheet1", "Sheet2")).Select ' Add as many sheets as you need
Range("A4").Select

"stewdizzle" wrote:

In my workbook i have VB code to select a specific cell based on
specific criteria. How can I select the corresponding cell on another
worksheet. For example I want to find cell A4 on Sheet 1 and select
both that cell and Cell A4 on Sheet2



Gary Keramidas

Selecting Cells on two worksheets
 
one way

Sub test2()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

ws1.Select
ws2.Select False
Range("A4").Select
End Sub

--


Gary


"stewdizzle" wrote in message
oups.com...
In my workbook i have VB code to select a specific cell based on
specific criteria. How can I select the corresponding cell on another
worksheet. For example I want to find cell A4 on Sheet 1 and select
both that cell and Cell A4 on Sheet2




stewart

Selecting Cells on two worksheets
 
that is kind of what i wanted but i need to search for a text string
that is on Sheet 1 and then select that cell on both sheets. I wont
actually know what the exact cell location is when i type my code



On Mar 4, 10:17 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
one way

Sub test2()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

ws1.Select
ws2.Select False
Range("A4").Select
End Sub

--

Gary

"stewdizzle" wrote in message

oups.com...

In my workbook i have VB code to select a specific cell based on
specific criteria. How can I select the corresponding cell on another
worksheet. For example I want to find cell A4 on Sheet 1 and select
both that cell and Cell A4 on Sheet2




Mark Dullingham

Selecting Cells on two worksheets
 
Look for the MATCH function in th VB Help files and use it to search an array
for you text string, the result will then be the cell you select in the code
I posted.

Sorry I haven't time to write and test a bit of code, this is a flying
visit, hopefully it put you in the right direction

Mark

"stewart" wrote:

that is kind of what i wanted but i need to search for a text string
that is on Sheet 1 and then select that cell on both sheets. I wont
actually know what the exact cell location is when i type my code



On Mar 4, 10:17 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
one way

Sub test2()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

ws1.Select
ws2.Select False
Range("A4").Select
End Sub

--

Gary

"stewdizzle" wrote in message

oups.com...

In my workbook i have VB code to select a specific cell based on
specific criteria. How can I select the corresponding cell on another
worksheet. For example I want to find cell A4 on Sheet 1 and select
both that cell and Cell A4 on Sheet2






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

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