Forum Discussion
Using a macro to apply two different conditional formatting functions to same table
Range("D2").Select
I think this line of code could be missing in your macro.
In the attached file you can run the code with and without this line to return the different results.
Without this line of code i have to manually select cell D2 before running the macro in order to have it working properly.
- kennyb21167Jan 14, 2022Copper ContributorSo, after downloading, opening and running the attached macro I am receiving an error message from Microsoft Visual Basic, "Run=time error '5': Invalid procedure call or argument with the option to End, Debug or Help. I am running Excel 2013 if that makes any difference.
I see that the previewed document appears like what I am after, but again after running the macro it only applied formatting to Columns A-D and not E.- OliverScheurichJan 14, 2022Gold Contributor
That's surprising because i am running Excel 2013 as well and the macro works as intended in my spreadsheet as you can see in the attached file. In which line of the code does the error appear in your sheet and can you attach your file without sensitive data? This could be helpful to determine why it's not working in your spreadsheet.
- kennyb21167Jan 22, 2022Copper Contributor
Sorry for the delayed reply. So I'm not quite sure where the error is occurring but I've attached a screenshot of what is happening and so you can see that only half of the macro is functioning on my end.
I have also reattached your example document after I have run/saved the macro and as you can see in worksheet 2 the macro did not run correctly.