PDA

View Full Version : [SOLVED] Scrolling multiple sheets to the same row



K. Georgiadis
05-01-2005, 04:21 PM
I have a workbook with 68 worksheets with the identical layout. I perform a lot of editing on individual worksheets but there are two classes of actions that require me to access data in either Row 118 or 333.

Can I use the Immediate Window to let all worksheets scroll to either row 118 or 333 all at once? That would make it a lot quicker to find my target cells.

MWE
05-01-2005, 07:15 PM
I have a workbook with 68 worksheets with the identical layout. I perform a lot of editing on individual worksheets but there are two classes of actions that require me to access data in either Row 118 or 333.

Can I use the Immediate Window to let all worksheets scroll to either row 118 or 333 all at once? That would make it a lot quicker to find my target cells.

If I understand your need, you want to have all worksheets "pointing" to a particular row when you move to them for editing. If so, you might try something like this:


Sub SelectSameRow()
Dim Row As Long
Dim xlsheet As Worksheet
Row = InputBox("row number?")
For Each xlsheet In ActiveWorkbook.Worksheets
xlsheet.Select
xlsheet.Range(Cells(Row, 1), Cells(Row, 1)).Select
Next xlsheet
End Sub

You could also set the column value if you wanted the active cell for each worksheet to be a special col as well.

K. Georgiadis
05-01-2005, 07:56 PM
This places the cursor on column A of the specified row, which is exactly what I need. Thanks for your help!

Since I am trying to learn as I go, how would I go about also specifying a column? Would I do that by changing the x value in (Row,x)?

Jacob Hilderbrand
05-01-2005, 08:03 PM
Yes, just replace x with the column number you want.
A=1
B=2
C=3

etc.

K. Georgiadis
05-02-2005, 05:04 AM
Thanks MWE and DRJ. This macro is going to save me quite a bit of time.