I am trying to understand how to write the following code in VBA rather than use the following formula which does work.
Column A formula:
=IF(AND(F2="Red\Recurring",B2="No"),"delete row",IF(AND(F2="Blue\Recurring",B2="No"),"delete row",IF(AND(F2="Yellow\Recurring",B2="No"),"delete row","ok")))
Column B is a formula too, which I am sure could become part of a more complicated piece of VBA code.
=IF(AND($E2="Yellow",$K2="orange)"),"Important",IF(AND($E2="Blue",$K2=""),"Important",IF(AND($E2="Red",$K2=""),"Important","No")))
The table I am using looks like this.
[TABLE="width: 1397"]
<tbody>[TR]
[TD]Keep[/TD]
[TD]Important[/TD]
[TD]Workstream[/TD]
[TD]Customer[/TD]
[TD]Team[/TD]
[TD]Path[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Sales and Trade Systems[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Account Planning[/TD]
[TD]Promo list[/TD]
[TD]Integration Account Planning[/TD]
[TD]Integration Account Planning\Iteration 13[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Enterprise Warehousing[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Enterprise Warehousing[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Financial Accounting Services[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Sales and Trade Systems[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]delete row[/TD]
[TD]No[/TD]
[TD]Integration Integration[/TD]
[TD]Interfaces[/TD]
[TD]Integration[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Order to Cash Core[/TD]
[TD]Master Data Gathering[/TD]
[TD]Integration[/TD]
[TD]Integration\Graveyard[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Customer Order Management[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]IT Process Governance[/TD]
[TD]Blue[/TD]
[TD]Blue\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Account Planning[/TD]
[TD]Planning UOM[/TD]
[TD]Integration[/TD]
[TD]Integration Account Planning\Iteration 13[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Office 365[/TD]
[TD]Site Owner Training (Admin Topics)[/TD]
[TD]Office 365\SharePoint - Online[/TD]
[TD]Office 365\Iteration 2[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Interim Reporting Database[/TD]
[TD]SKU: Leading zeros causing SKU to exist in multiple formats[/TD]
[TD]Interim Reporting Database\Master Data[/TD]
[TD]Interim Reporting Database\Iteration 9[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Blue[/TD]
[TD]Applications[/TD]
[TD]Blue[/TD]
[TD]Blue\Recurring[/TD]
[/TR]
[TR]
[TD]delete row[/TD]
[TD]No[/TD]
[TD]Yellow[/TD]
[TD]AP & Treasury[/TD]
[TD]Yellow[/TD]
[TD]Yellow\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Prep[/TD]
[TD]Cutover/Testing/Secuirty[/TD]
[TD]Red[/TD]
[TD]Prep\Iteration 11
[/TD]
[/TR]
</tbody>[/TABLE]
Column A formula:
=IF(AND(F2="Red\Recurring",B2="No"),"delete row",IF(AND(F2="Blue\Recurring",B2="No"),"delete row",IF(AND(F2="Yellow\Recurring",B2="No"),"delete row","ok")))
Column B is a formula too, which I am sure could become part of a more complicated piece of VBA code.
=IF(AND($E2="Yellow",$K2="orange)"),"Important",IF(AND($E2="Blue",$K2=""),"Important",IF(AND($E2="Red",$K2=""),"Important","No")))
The table I am using looks like this.
[TABLE="width: 1397"]
<tbody>[TR]
[TD]Keep[/TD]
[TD]Important[/TD]
[TD]Workstream[/TD]
[TD]Customer[/TD]
[TD]Team[/TD]
[TD]Path[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Sales and Trade Systems[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Account Planning[/TD]
[TD]Promo list[/TD]
[TD]Integration Account Planning[/TD]
[TD]Integration Account Planning\Iteration 13[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Enterprise Warehousing[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Enterprise Warehousing[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Financial Accounting Services[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Sales and Trade Systems[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]delete row[/TD]
[TD]No[/TD]
[TD]Integration Integration[/TD]
[TD]Interfaces[/TD]
[TD]Integration[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Order to Cash Core[/TD]
[TD]Master Data Gathering[/TD]
[TD]Integration[/TD]
[TD]Integration\Graveyard[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]Customer Order Management[/TD]
[TD]Red[/TD]
[TD]Red\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Red[/TD]
[TD]IT Process Governance[/TD]
[TD]Blue[/TD]
[TD]Blue\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Integration Account Planning[/TD]
[TD]Planning UOM[/TD]
[TD]Integration[/TD]
[TD]Integration Account Planning\Iteration 13[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Office 365[/TD]
[TD]Site Owner Training (Admin Topics)[/TD]
[TD]Office 365\SharePoint - Online[/TD]
[TD]Office 365\Iteration 2[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]No[/TD]
[TD]Interim Reporting Database[/TD]
[TD]SKU: Leading zeros causing SKU to exist in multiple formats[/TD]
[TD]Interim Reporting Database\Master Data[/TD]
[TD]Interim Reporting Database\Iteration 9[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Blue[/TD]
[TD]Applications[/TD]
[TD]Blue[/TD]
[TD]Blue\Recurring[/TD]
[/TR]
[TR]
[TD]delete row[/TD]
[TD]No[/TD]
[TD]Yellow[/TD]
[TD]AP & Treasury[/TD]
[TD]Yellow[/TD]
[TD]Yellow\Recurring[/TD]
[/TR]
[TR]
[TD]ok[/TD]
[TD]Important[/TD]
[TD]Prep[/TD]
[TD]Cutover/Testing/Secuirty[/TD]
[TD]Red[/TD]
[TD]Prep\Iteration 11
[/TD]
[/TR]
</tbody>[/TABLE]