Saturday, December 24th, 2011
Daily Archive
Daily Archive
This macro will alternate the alignment of the current selection:
<pre>Public Sub SetAlign()
Dim oCell As Range
For Each oCell In Selection
If oCell.Row Mod 2 = 0 Then
oCell.HorizontalAlignment = xlHAlignLeft
Else
oCell.HorizontalAlignment = xlHAlignRight
End If
Next oCell
End Sub
</pre>
http://windowssecrets.com/forums/showthread.php/17738-Conditional-formatting-alignment-%28Excel-97-SR2%29