vendredi 31 mai 2019

How do I fix the error in the first step of a circular VBA code

424 Error in the first step of my Macro. What is causing the issue?

Here is what I currently have.

Sub Macro1()
'
' Macro1 Macro 
'
' Keyboard Shortcut: Ctrl+Shift+P
'
    If Selection.Style = "Percent" Then
        Selction.Stlye = "Currency"
    ElseIf Selection.Style = "Currency" Then
        Selection.Style = "Normal"
    ElseIf Selection.Style = "Normal" Then
        Selection.Style = "Percent"
   End If
End Sub

The Elseif lines are working as intended. I can toggle from currency to normal to percent just fine and the way I intended. One I reach percent though I get a 424 error and the debugger highlights the line "Selection.Style = "Currency". I cannot figure out what is causing the error.

Aucun commentaire:

Enregistrer un commentaire