View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Jump to cell in other worksheet

Assume your string is in cell A1 of Sheet1.

In the code module for sheet1



Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim sStr As String, iloc As Long, sName
Dim sRow As String, sCol As String

If Target.Count 1 Then Exit Sub
If Target.Address < "$A$1" Then Exit Sub
sStr = Range("A1").Value
iloc = InStr(sStr, "!")
sName = Left(sStr, iloc - 1)
sCell = Right(sStr, Len(sStr) - iloc)
iloc = InStr(sCell, ",")
sRow = Mid(sCell, 7, iloc - 7)
sCol = Mid(sCell, iloc + 1, Len(sCell) - iloc - 1)
Worksheets(sName).Activate
Worksheets(sName).Cells(CLng(sRow), CLng(sCol)).Select
End Sub

You can add some error checking.





--
Regards,
Tom Ogilvy

"Roel van der Heide" wrote in message
om...
Hello,

In my worksheet Sheet1 I have a cell containing the string
"Sheet2!Cells(10,10)". How can I jump to the cell and make changes to
it?

Thanks in advance,

Roel van der Heide