Working with multiple sheets

N

Nav

Hello

I am holding shift (or Ctrl) and adding data to the cells in all the sheets.
However the page does not appear to move on the other sheets although the
data has been input.

Eg. all sheets when viewed start at Col A Row 1. I add data to col Z row 1
( the sheet I am working on now shows Col Z as the first col when viewed),
however when viewing the other sheets they still start at Col A (although the
data added is in the correct col/row).

Is there a way that the cell selection for all the sheets can be done -
hence it actually moves with the sheet you are working on?

Any ideas appreciated and thank you in advance.

Regards, Nav
 
D

Don Guillett

Try

Sub gotoselections()
For Each sh In ActiveWorkbook.Windows(1).SelectedSheets
MsgBox sh.Name
Application.Goto sh.Range("k1") ', scroll:=True
Next
End Sub
 
N

Nav

Tthis does the trick - I thought there would have been another way without VBA.

Thank you.
 
N

Nav

Sorry - is there a way that it just follows the scrolling undertaken on the
first sheet instead of having to go into the macor and change the reference
all the time.

Thank you again.
 
N

Nav

Sorry if it is not clear. But as I am entering data in the main sheet with
other sheets selected (by holding down CTRL) I am not sure of which cell I
will end in (as it depends on the amount of data that requires entry). Hence
is there a way that the other sheets will move to the correct cell too
without having to amend this in the macro.

ie. the sheet I am working on may start from coll AA to AN, whereas the
other sheets still remain on Col A currently - but I would like them to also
start from AA to AN when I select the sheet upon completion of entering the
data.

I hope this is a little clearer.

Thank you.
 
D

Don Guillett

Try it this way with the line below at the top of the module

Public mc

Sub gotoselections()
mc = ActiveCell.Column
For Each sh In ActiveWorkbook.Windows(1).SelectedSheets
MsgBox sh.Name
MsgBox mc
Application.Goto sh.Cells(1, mc) ', scroll:=True
Next
End Sub
 
N

Nav

Thank you - this works a lot better.

Don Guillett said:
Try it this way with the line below at the top of the module

Public mc

Sub gotoselections()
mc = ActiveCell.Column
For Each sh In ActiveWorkbook.Windows(1).SelectedSheets
MsgBox sh.Name
MsgBox mc
Application.Goto sh.Cells(1, mc) ', scroll:=True
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top