S
schalliol
Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
I would like to create an AppleScript to simply change the highlighted cells to text format "#,##0.0_);(#,##0.0)" I would like to be able to do this with a keypress like command-shift-d or similar. I would think there'd be some sort of way to do that. Assuming this is possible, I'd like to make it toggle between common formats, like the VBA version below. It seems there ought to at least be a way to apply a pre-defined format. Any help would be greatly appreciated!
Sub CurrencyFormattingToggle()
If Selection.NumberFormat = "General" Then
Selection.NumberFormat = "#,##0.0_);(#,##0.0)"
ElseIf Selection.NumberFormat = "#,##0.0_);(#,##0.0)" Then
Selection.NumberFormat = "$#,##0.0_);($#,##0.0)"
ElseIf Selection.NumberFormat = "$#,##0.0_);($#,##0.0)" Then
Selection.NumberFormat = "#0.0x"
ElseIf Selection.NumberFormat = "#0.0x" Then
Selection.NumberFormat = "0.0%_);(0.0%)"
Else: Selection.NumberFormat = "General"
End If
End Sub
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
I would like to create an AppleScript to simply change the highlighted cells to text format "#,##0.0_);(#,##0.0)" I would like to be able to do this with a keypress like command-shift-d or similar. I would think there'd be some sort of way to do that. Assuming this is possible, I'd like to make it toggle between common formats, like the VBA version below. It seems there ought to at least be a way to apply a pre-defined format. Any help would be greatly appreciated!
Sub CurrencyFormattingToggle()
If Selection.NumberFormat = "General" Then
Selection.NumberFormat = "#,##0.0_);(#,##0.0)"
ElseIf Selection.NumberFormat = "#,##0.0_);(#,##0.0)" Then
Selection.NumberFormat = "$#,##0.0_);($#,##0.0)"
ElseIf Selection.NumberFormat = "$#,##0.0_);($#,##0.0)" Then
Selection.NumberFormat = "#0.0x"
ElseIf Selection.NumberFormat = "#0.0x" Then
Selection.NumberFormat = "0.0%_);(0.0%)"
Else: Selection.NumberFormat = "General"
End If
End Sub