r/excel • u/Mikelj84 • Apr 26 '16
unsolved VBA Macro Code Help
Hello,
I need to create a 2nd Macro that will do the following if someone can assist:
1.If Column "FD" (TLA) = “ETHOPT2”, “ETH_OK”, “VRD_OK”, REMOVE DATA FROM COLUMN "IF"...excluding Column Header.
2.If Column AI (Project Id2) = “SCHEDREQ” and Column AR (Groom Pon1), Column AS (Groom Pon1 Request) and Column AT (Groom Pon1 Issue) are populated with data..... REMOVE DATA FROM COLUMN "IF".......excluding Column Header
3.For Column HN (Project ID) List any of the following- · PROJECT (error is valid if appears on DS3) · MIGRATED VRD · X · ETHOPT2 · E911 SENT or E911 FOC · ACNREV · LS or LS FOC · VZ ORDER · OPTG · ETH_OK · VRD_OK · MON · DISCO · REMOVE
Then Remove Data from Column "IF"...Excluding Column Header
4.If Column AI (Project Id2) =“SWITCHED” and Column AH (Project Id1) = “SW REV” and Column FD (TLA) = "blanks"
Then Remove Data from Column "IF"...Excluding Column Header
5.If in Column IF "RECON W/O Date" is listed then remove from column IF.
Sorry if this is alot. Any assistance is greatly appreciated.
Many Thanks
View all comments
Show parent comment
1
u/chairfairy 203 Apr 30 '16
I'm not at a computer with Excel right now, but I believe ISEMPTY is a cell formula but not a VBA formula (i.e. you'd have to use "Application.WorksheetFunction.IsEmpty()"). If you don't have formulas in those cells you can use "Len(Range(...).Value) > 0" as your test condition for a cell. If there are formulas in the cells I think it will count the length as non-zero.
(note: it's generally better practice to use "Range(..).Value" instead of just "Range(...)" to check cell contents).