I am trying to create a macro to cycle through several through the following number formats:
#,##0.0_);(#,##0.0);-_)
$#,##0.0_);($#,##0.0);-_)
#,##0.0%_);(#,##0.0%)
"#,##0.0x_);(#,##0.0x)
I have similar code for font colors, which is below:
Can someone please help me write the same type of code, but for the number formats I have listed above? I tried but was unable to use similar syntax to make it work. Would be very much appreciated!
Thank you so much!
#,##0.0_);(#,##0.0);-_)
$#,##0.0_);($#,##0.0);-_)
#,##0.0%_);(#,##0.0%)
"#,##0.0x_);(#,##0.0x)
I have similar code for font colors, which is below:
Code:
Sub CycleColor()
Dim Color1 As Long, Color2 As Long
Dim Color3 As Long, Color4 As Long
Color1 = RGB(0, 0, 0)
Color2 = RGB(0, 0, 255)
Color3 = RGB(0, 128, 0)
Color4 = RGB(255, 0, 0)
With Selection.Font
If .Color = Color1 Then
.Color = Color2
ElseIf .Color = Color2 Then
.Color = Color3
ElseIf .Color = Color3 Then
.Color = Color4
ElseIf .Color = Color4 Then
.Color = Color1
Else
.Color = Color1
End If
End With
End Sub
Can someone please help me write the same type of code, but for the number formats I have listed above? I tried but was unable to use similar syntax to make it work. Would be very much appreciated!
Thank you so much!