I need some help making modifications to vba that applies conditional formats to one of my reports. The existing macro creates a conditional format and copies the format over the entire report.
The vba I use creates a conditional format on cell $A8 and bolds the cell if it starts with " [" then copies the conditional format throughout the report Range(A9:S500). This macro is based on data starting in A8. For example, the macro would make the rows below bold for [504050_Allocation_AdminExps], [510150_BankFees], and [510150_TotalBankFees]. I'm trying to copy and modify the vba to make 2 new conditional formats.
1. Apply the "Top and Bottom Border" to cells that contain "Total"
2. Apply the "Top and Double Bottom Border" to cells that contain "ABC Net Gain"
Column A
[Expenses]Expenses
[504050_Allocation_AdminExps] Allocation Admin Expense
[510150_BankFees] Bank Fees
item 1
item 2
item 3
[510150_BankFees] Total Bank Fees
[TotalABCExpense] Total ABC Expense
[ABCNETGAIN] ABC Net Gain
Existing Macro:
' Conditional Format
Range("A8").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=(LEFT($A8,3)="" ["")"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.Copy
Range("A9:S500").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Any help or suggestions are greatly appreciated. Thanks in advance for your help!
Ben
The vba I use creates a conditional format on cell $A8 and bolds the cell if it starts with " [" then copies the conditional format throughout the report Range(A9:S500). This macro is based on data starting in A8. For example, the macro would make the rows below bold for [504050_Allocation_AdminExps], [510150_BankFees], and [510150_TotalBankFees]. I'm trying to copy and modify the vba to make 2 new conditional formats.
1. Apply the "Top and Bottom Border" to cells that contain "Total"
2. Apply the "Top and Double Bottom Border" to cells that contain "ABC Net Gain"
Column A
[Expenses]Expenses
[504050_Allocation_AdminExps] Allocation Admin Expense
[510150_BankFees] Bank Fees
item 1
item 2
item 3
[510150_BankFees] Total Bank Fees
[TotalABCExpense] Total ABC Expense
[ABCNETGAIN] ABC Net Gain
Existing Macro:
' Conditional Format
Range("A8").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=(LEFT($A8,3)="" ["")"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.Copy
Range("A9:S500").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Any help or suggestions are greatly appreciated. Thanks in advance for your help!
Ben