I am new as you will quickly learn. In the following code I ask the macro to evaluate column E for two conditions and then change the cell formatting of cells D, J, K, and M. However when I run it only K (offset (0,4)) is getting the cell format change, but none of the others.
Any Idea why?
'Set range variable to first Unit in Item list
Set c = Sheets("Estimate").Range("E7")
Do While c.Value <> ""
'Evalute Unit value to set number format and format cell of same row but offset column
If c.Value = "LS" Or c.Value = "FPLS" Then
Set fmtc = c.Offset(0, -1)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 3)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 4)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 6)
Selection.NumberFormat = "0.00%"
Else
End If
'Move variable range to next Unit in column
Set c = c.Offset(1, 0)
Loop
Thanks a bunch...
Any Idea why?
'Set range variable to first Unit in Item list
Set c = Sheets("Estimate").Range("E7")
Do While c.Value <> ""
'Evalute Unit value to set number format and format cell of same row but offset column
If c.Value = "LS" Or c.Value = "FPLS" Then
Set fmtc = c.Offset(0, -1)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 3)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 4)
Selection.NumberFormat = "0.00%"
Set fmtc = c.Offset(0, 6)
Selection.NumberFormat = "0.00%"
Else
End If
'Move variable range to next Unit in column
Set c = c.Offset(1, 0)
Loop
Thanks a bunch...