Forum Discussion
SteveNBethesda
Jun 14, 2022Copper Contributor
Macro Type Error
I just upgraded to Office 365 and now one of my macros is generating a Type Mismatch error. The macro is pasted below, and the offending code is highlighted in red, bold italics. I would greatly appr...
mtarler
Jun 16, 2022Silver Contributor
A few more suggestions:
never use .select, selection. and ActiveCell. if you can avoid it. Just use the cell reference.
as for the line with an issue you don't even need the AND as the first IF statement is IF NOTPROCESSED so therefore the ELSEIF must have PROCESSED = TRUE so just drop that and use ELSEIF NOTPAID.
As already noted you can drop the extra PROCESSED & PAID variables
But most importantly, as suggested, just use conditional formatting.
never use .select, selection. and ActiveCell. if you can avoid it. Just use the cell reference.
as for the line with an issue you don't even need the AND as the first IF statement is IF NOTPROCESSED so therefore the ELSEIF must have PROCESSED = TRUE so just drop that and use ELSEIF NOTPAID.
As already noted you can drop the extra PROCESSED & PAID variables
But most importantly, as suggested, just use conditional formatting.
SteveNBethesda
Jun 16, 2022Copper Contributor
Thanks for the additional suggestions. I plan to create a copy of my spreadsheet and experiment with all the suggested REPLIES.
Have a great day!!!
Have a great day!!!