English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

for example, if a4+a5=4 then go to tab so and so?

2007-12-07 03:51:15 · 2 answers · asked by Anonymous in Computers & Internet Software

2 answers

You may need to use Visual Basic to do this and the Goto method.

Application.Goto Reference:=
Worksheets("Sheet1")
.Range("A154"),_scroll:=True

All the above is typed on one line. This is only the one small part of the VB that will change you to another sheet and, in this case, to cell A154 of Sheet1.

There is much more to Visual Basic than this on small snip. You will need to do some research into Visual Basic if you have not used it.

2007-12-07 20:28:16 · answer #1 · answered by vbmica 7 · 0 0

Assume your formula =a4+a5 is in Cell A6 and the sheet's tag name is Sheet1, other sheets' tag name are Sheet2, Sheet3, Sheet4, ...
Alt-F11 to open VBA editor, and double click on left Sheet1(Sheet1) icon then paste the following code to the right blank area

Dim shtno
Private Sub Worksheet_Activate()
      shtno = Worksheets( "Sheet1").range( "A6").value
End Sub
Private Sub Worksheet_Calculate()
On Error GoTo lastline
If range("A6") <> shtno Then
      sheetno = range( "A6").value
      Worksheets( "Sheet" & sheetno).Activate
End If
lastline:
End Sub

when you change number in A4 or A5, the sum show in A6 will be the sheet number that you're redirected to, if there is such a sheet.
Here's a demo http://www.freewebs.com/swhtam/YA/jumpByNumber.xls
Hope this helps.

2007-12-13 14:44:38 · answer #2 · answered by AQuestionMark 7 · 0 0

fedest.com, questions and answers