Can someone please help me write the proper code for cycling between different Center and Underline Formats?
For the Center Cycle, the code would go from General Alignment, to Center, to Center Across Selection, and then back to General.
For the Underline Cycle, the code would go from General, to Normal Underline, to Single Accounting Underline.
I have some similar code from a Number Format Cycle that switches between several colors, shown below:
I'm hoping to do something similar to this, but for the formatting issues I described above.
Thanks so much in advance!
For the Center Cycle, the code would go from General Alignment, to Center, to Center Across Selection, and then back to General.
For the Underline Cycle, the code would go from General, to Normal Underline, to Single Accounting Underline.
I have some similar code from a Number Format Cycle that switches between several colors, shown below:
Code:
Sub CycleFormat()
Dim Format1 AsString, Format2 AsString
Dim Format3 AsString, Format4 AsString
Format1 = "#,##0.0_);(#,##0.0);-_)"
Format2 = "$#,##0.0_);($#,##0.0);-_)"
Format3 = "#,##0.0%_);(#,##0.0%)"
Format4 = "#,##0.0x_);(#,##0.0x)"
With Selection
If .NumberFormat = Format1 Then
.NumberFormat = Format2
ElseIf .NumberFormat = Format2 Then
.NumberFormat = Format3
ElseIf .NumberFormat = Format3 Then
.NumberFormat = Format4
ElseIf .NumberFormat = Format4 Then
.NumberFormat = Format1
Else
.NumberFormat = Format1
EndIf
EndWith
EndSub
I'm hoping to do something similar to this, but for the formatting issues I described above.
Thanks so much in advance!