LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default ComboBox Code Error

The below ComboBox code is intended to launch a hyperlink, or start a macro,
based on user selection. The ComboBox operates okay, and Case Hyperlink
works, but Case Run Macro generates a Run time error 1004: The macro Sub
GoToTFMWorksheetPage1() cannot be found, with the two lines beginning
Application.run yellow highlighted. Cell range G81:G86 holds the action
names Hyperlink or Run Macro, with the hyperlink or macro name immediately
adjacent in cells F81:F86. The macro is located in the worksheet module
where the ComboBox is located, and the text of the macro name was copy/pasted
into the code to assure exact macro name recognition. Could someone suggest
how to correct this problem?
Thanks, Phil

Option Explicit

Private Sub ComboBox1_Click()
With ThisWorkbook.ActiveSheet.Range("A79")
Select Case Range("F81:F86").Cells(ComboBox1.ListIndex + 1, 1).Value
Case "Hyperlink"
ThisWorkbook.FollowHyperlink _
Range("G81:G86").Cells(ComboBox1.ListIndex + 1, 1).Value
Case "Run Macro"
Application.Run _
Range("G81:G86").Cells(ComboBox1.ListIndex + 1, 1).Value
Case Else
MsgBox "This selection has no hyperlinked document or linked
worksheet.", vbInformation + vbOKOnly, "Information:"
End Select
End With
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combobox code [email protected] uk Excel Discussion (Misc queries) 0 December 20th 09 06:21 PM
combobox code [email protected] uk Excel Discussion (Misc queries) 0 December 20th 09 08:28 AM
combobox code [email protected] uk Excel Discussion (Misc queries) 2 December 19th 09 08:37 AM
ComboBox Code John Calder New Users to Excel 4 July 28th 09 01:17 AM
ComboBox code Alexandre Ferreira Excel Worksheet Functions 1 January 11th 07 02:52 PM


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"