I am trying to do a toggle shortcut key for number formats. I have come up with the below but the only issues is if the existing number format is not one of the below it will not start the toggle. I keep getting an error "Case Mismatch on the 2nd Case (after the "Case All")
Sub AlexNum()
Select Case Selection.NumberFormat
Case All
Selection.NumberFormat = "(* #,##0.00);(* (#,##0.00);(* " - "??);(@)"
Case "(* #,##0.00);(* (#,##0.00);(* " - "??);(@)": Selection.NumberFormat = "($* #,##0.00);(*$ (#,##0.00);(*$ " - "??);($@)"
Case "($* #,##0.00);(*$ (#,##0.00);(*$ " - "??);($@)": Selection.NumberFormat = "#,##0%"
Case "#,##0%": Selection.NumberFormat = "###,###x"
Case "###,###x": Selection.NumberFormat = "mm/dd/yyyy"
Case "mm/dd/yyyy": Selection.NumberFormat = "mmm-yyyy"
Case "mmm-yyyy": Selection.NumberFormat = "General"
Case Else: Selection.NumberFormat = "General"
End Select
End Sub
Basically i need this macro toggle to work regardless of what format is set in the cell which is why i needed the "Case All". Any help out there
Sub AlexNum()
Select Case Selection.NumberFormat
Case All
Selection.NumberFormat = "(* #,##0.00);(* (#,##0.00);(* " - "??);(@)"
Case "(* #,##0.00);(* (#,##0.00);(* " - "??);(@)": Selection.NumberFormat = "($* #,##0.00);(*$ (#,##0.00);(*$ " - "??);($@)"
Case "($* #,##0.00);(*$ (#,##0.00);(*$ " - "??);($@)": Selection.NumberFormat = "#,##0%"
Case "#,##0%": Selection.NumberFormat = "###,###x"
Case "###,###x": Selection.NumberFormat = "mm/dd/yyyy"
Case "mm/dd/yyyy": Selection.NumberFormat = "mmm-yyyy"
Case "mmm-yyyy": Selection.NumberFormat = "General"
Case Else: Selection.NumberFormat = "General"
End Select
End Sub
Basically i need this macro toggle to work regardless of what format is set in the cell which is why i needed the "Case All". Any help out there