MrExcel Publishing
Your One Stop for Excel Tips & Solutions

UserForm that views another sheet

Posted by Jim on July 29, 2001 8:46 AM

I have a workbook with 2 sheets. I do my work on sheet1
and copy and paste the results into sheet 2. I have a
userform in sheet 1 that i use to view sheet 2. This is
my question is it possible to link the 2. In other words
whatever row i'm on in sheet 1 the userform would have
the ? "focus" to be on the same row.
Thanks for any advice

Posted by Rob on July 30, 2001 1:22 AM

Jim, If I get what you are driving at, you want to track up and down two sheets at the same rate. This is straightforward. I'll demonstrate with a single column of each sheet. Set in a scroll bar called SCB and two text boxes TB1 and TB2 representing the values of a cell in the A column on Sheet1 and Sheet2 respectively. Then on the SCB click event use the code IB1.controlsource = "'[filename]Sheet1'!A" & SCB.value and duplicate for IB" with IB2.controlsource = "'[filename]Sheet2'!A" & SCB.value this way when the scroll bar changes both cells map to the same row on different sheets. (The ' used in the formula allows sheet and filenames with spaces to be used).