View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KenInPortland KenInPortland is offline
external usenet poster
 
Posts: 9
Default 2003 macro generates compiler error on 2007

The following macro works fine in Excel 2003 but generates a compiler error
on 2007. Any ideas or direction?

Sub WhoRang()
Dim ButtonLabel As String
Dim First6chars As String
Dim RowNum As String
ButtonLabel = Application.Caller
' 2007 compiler error occurs here
First6chars =
Left(ActiveSheet.Shapes(ButtonLabel).TextFrame.Cha racters.Text, 6)
RowNum = Range("N1:N32").Find(What:=First6chars).Row
Application.GoTo Range(Range("O" & RowNum).Value)
End Sub