Discussion Locked

Excel 97 Macro

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have 2 workbooks that have the same information in both of them. I have to figure out how to write a macro that when for example you click on Workbook1_Sheet1!A1 it scrolls through Workbook2_Sheet1!A1. So, if I choose cell Workbook1_Sheet1!B23000 it goes to the same cell in the second book. Is this possible?

Thanks,
Michele

7 replies

by dklippert

Could you be a little more specific about your goal. When you say "scroll", do you mean look at a list such as using a combo box?

by schwar3

I mean that when a cell is selected in workbook1 that it finds and selects the same cell in workbook2:
Workbook1_Sheet1!A45 = Workbook2_Sheet1!A45

My problem was that I was able to create a macro so that:
workbook1_sheet1!A34 = workbook2_sheet1!A34
but then,
workbook1_sheet1!A50 = workbook2_sheet1!A34
which is not what I want.

I hope this helps,
Michele

by schwar3

Doug,
I tried to send you an email, but it bounced. Anyhow, here's the sample code:

Sub FindSameCell()
'
' FindSameCell Macro
' Macro recorded 6/26/2003 by Michele R Schwartzman
'
Range("A4").Select
Windows("Example 2.xls").Activate
Range("A4").Select
End Sub

Thanks for your help.

by dklippert

Sub FindSameCell()
Dim Cell_Location As String
Cell_Location = ActiveCell.Address()
Windows("Example 2.xls").Activate
Range(Cell_Location).Select
End Sub

This discussion is closed to new replies.