ITALIAORIANA
Technical User
Hi,
I posted this in the wrong forum originally. I re-posted here. I am having computer issues so please forgive me if it shows up twice.
I have a spreadsheet in excel 2003 that I have conditional formatting =NOT(B2=C2) to highlight the differences. I recorded a macro to format the rest of the columns like this.
I did each column individually because I don't know any other way to do it. I only got to column BI but doing it like that is a long tedious process. Is there an easier way to use the conditional formatting for all columns but keep the original format of the cell? Some of the fields are alpha numeric, some are dates, some are numbers, etc so for example I would still need the dates to be formatted as dates. I tried to just copy and paste the conditional formatting for the entire spreadsheet but the dates were no longer formatted as dates. In the example you will see that BI is compared to BH, but then I have to compare BH to BI so that both columns will be highlighted if there is a difference. I have posted a portion of the macro I currently have.
Any help would be greatly appreciated.
Thanks
Deana
Range("BH2").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=NOT(BH2=BI2)"
Selection.FormatConditions(1).Interior.ColorIndex = 24
Selection.Copy
Columns("BH:BH").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("BI2").Select
Selection.Copy
Range("BI2").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=NOT(BI2=BH2)"
Selection.FormatConditions(1).Interior.ColorIndex = 24
Selection.Copy
Columns("BI:BI").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
I posted this in the wrong forum originally. I re-posted here. I am having computer issues so please forgive me if it shows up twice.
I have a spreadsheet in excel 2003 that I have conditional formatting =NOT(B2=C2) to highlight the differences. I recorded a macro to format the rest of the columns like this.
I did each column individually because I don't know any other way to do it. I only got to column BI but doing it like that is a long tedious process. Is there an easier way to use the conditional formatting for all columns but keep the original format of the cell? Some of the fields are alpha numeric, some are dates, some are numbers, etc so for example I would still need the dates to be formatted as dates. I tried to just copy and paste the conditional formatting for the entire spreadsheet but the dates were no longer formatted as dates. In the example you will see that BI is compared to BH, but then I have to compare BH to BI so that both columns will be highlighted if there is a difference. I have posted a portion of the macro I currently have.
Any help would be greatly appreciated.
Thanks
Deana
Range("BH2").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=NOT(BH2=BI2)"
Selection.FormatConditions(1).Interior.ColorIndex = 24
Selection.Copy
Columns("BH:BH").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("BI2").Select
Selection.Copy
Range("BI2").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=NOT(BI2=BH2)"
Selection.FormatConditions(1).Interior.ColorIndex = 24
Selection.Copy
Columns("BI:BI").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False