Forum Discussion

Greg Bonaparte's avatar
Greg Bonaparte
Iron Contributor
Mar 21, 2020

I'm getting compile error Else without if

I'm getting "compile error Else without if". Anyone know why?

 

Sub AddSymbols()
'
'
'

'

Range("BC3:BI3").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

A = MsgBox("Add Additional Symbols?", vbQuestion + vbYesNo, "HonorSystem24")


ElseIf A = vbNo Then

Call PasteLastLine


If A = vbYes Then

End If

End Sub

2 Replies

  • supercheeba's avatar
    supercheeba
    Copper Contributor

    how to adjust size of excel sheet and keep it open and accessible while viewing another app or another excel sheet.

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    Greg Bonaparte Update your code to:

    Sub AddSymbols()
    '
    '
    '
    
    '
    
    Range("BC3:BI3").Select
    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    A = MsgBox("Add Additional Symbols?", vbQuestion + vbYesNo, "HonorSystem24")
    If A = vbNo Then
        Call PasteLastLine
    ElseIf A = vbYes Then
    End If
    End Sub

Resources