PDA

View Full Version : [SOLVED] Text box to return cell value from other sheet



Sir Babydum GBE
07-07-2005, 01:02 PM
Hi

I'm hoping to be able to have an automatic text box - with fairly large fonts - that will return the contents of, say, B1 on sheet2 when I click on B1 on sheet1, and the other way round. Whatever cell I click on the one sheet, it should display the value of the same cell on the other sheet. This may involve merged cells too.

Also, can this code copy any merging/demerging or formatting that I do on the one sheet straight onto the other sheet simultaneously.

Can this be done please?

Thanks in advance.

Sir Babydum GBE
07-07-2005, 11:16 PM
I just realised. It doesn't need to be a text box, it could just be, say, cell A1 - because i can freeze the panes on both sheets.

e.g. what ever cell I select on sheet 1, then the contents of the same cell on sheet2 (could be merged) will appear in A1 (of sheet 1).

The basic reason for this is that both sheets behave like a calendar. Sheet 1 will show related information to sheet 2 for the same day and time etc. So as the user is looking through the different days, he doesn't need to keep clicking back and forth between sheets to see the other info. It would also be nice if the same cell on the sister sheet were also selected as the user navigated through the other sheet. This is so that if he needs to create or amend an entry based on what he sees in A1, he does not need then to find the date and time - it will already be on the right cell when he switches sheets.
Any help on this would really be appreciated. Thx

Steiner
07-07-2005, 11:21 PM
Something like that (it goes into the code-module of the workbook that shows the value):


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
ActiveSheet.Range("A1").Value = Worksheets("Tabelle2").Cells(Target.Row, Target.Column)
End Sub

Sir Babydum GBE
07-14-2005, 07:04 AM
Steiner,

Just found this old post and was dissapointed to see that I forgot to say thanks, so...

Thanks!