changing sheet based on cell value

jslomax

New Member
Joined
Nov 20, 2005
Messages
15
I have the value in cell IV1 being being changed via a DDE link on each sheet. I would like to go to cell A1 on the sheet number contained in cell IV1 (ie if the link provides a value of 3, I want to go to sheet 3 cell A1. I placed the DDE linked value on each sheet thinking the non-active sheets would not be updating.

Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
How's this:

Code:
Private Sub Worksheet_Calculate()
    Application.Goto Sheets("Sheet" & Range("IV1")).Range("A1")
End Sub

Hope that helps,

Smitty
 
Upvote 0
Gotcha,

I forgot to mention to use a linked cell that will calculate when your DDE cell updates.

Smitty
 
Upvote 0
I just got it to work using this code:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
If Range("iv1").Value = 1 Then Sheets("Sheet1").Activate
If Range("iv1").Value = 2 Then Sheets("Sheet2").Activate
If Range("iv1").Value = 3 Then Sheets("Sheet3").Activate
ActiveSheet.Range("a1").Select
End Sub

thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top