How to call a popup from a link inside another popup?

Excel Macro Help, stopping popup error box?

  • Hello, I am trying to write a macro that automatically links data from another workbook based on the sheet name that is populated in column A. The problem is sometimes there is no sheet set, so when I run the macro a popup box comes up wanting me to select a sheet set. I would rather try to stop this box or not populate the cell at all. Sub Links() 'Running Macro Reply = MsgBox("This Macro will create Links" & Chr(10) & "Would you like to run this?", vbYesNo) If Reply = vbYes Then GoTo Line50 Else: GoTo Line700 Line50: 'Getting Link Properties Line100: Sheets("Test").Select Dim counter For counter = 3 To 5000 COUNTER2 = Range("A" & counter) JOBNUM = [COUNTER2] 'Making Links LINE200: If JOBNUM = "" Then GoTo LINE600 Line300: Range("M" & counter).Select ActiveCell = "=HYPERLINK(" & Chr(34) & "[Job Times.xlsx]'" & JOBNUM & "'!a1" & Chr(34) & ",SUM(N" & counter & ":Y" & counter & "))" Line350: Range("N" & counter).Select ActiveCell = "='F:\Production Tracking\[Job Times.xlsx]" & JOBNUM & "'!$F$5" On Error Resume Next ' ^---This is where I have problem of a popup box if the sheet doesn't exist Line400: Next counter LINE600: MsgBox "Auto Link Complete!" GoTo Line800 Line700: MsgBox "Auto Link Terminated" Line800: End Sub

  • Answer:

    Application.DisplayAlerts = False On Error Resume Next ... Do your thing Application.DisplayAlerts = True On Error GoTo 0 ... Do whatever comes next

Zenkai at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.