Excluding a string

  • Thread starter Thread starter arshia22
  • Start date Start date
A

arshia22

Hi all;
I use the following macro to jump from one worksheet to another (based
on the reference cell)

Sub Auto_Open()
' Adds Ctrl G shortcut to workbook
Application.OnKey "^g", "GoToCell"
End Sub
Sub GoToCell()
'
' GoToCell Macro
' Keyboard Shortcut: Ctrl+g
'
'Goes to precedent cell for cell that is activated

On Error Resume Next
Application.Goto Reference:=Mid(ActiveCell.FormulaR1C1, 2)

End Function

but some of the cells that refering to other worksheets' cell, are like
=SUM('sheet4!G:G), and because of SUM, the macro doesnt work. Is there
any way to exclude the string SUM in the macro and then running it.

Thanks
Sean
 
Can you use something like

Application.Goto Reference:=range(activecell.DirectPrecedents.Address)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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

Back
Top