Form control = adds blank row below row I'm currently in, conditional formatting and formula.

Copper Contributor

I hope I explain this correctly


C5 = todays date    =TODAY()


Column M = Has this formula    =IF(I2="","",I2-C$5)    it calculates the difference in days from a random date(Column I)  and it had conditional formatting if M<8 its red and if M is between 30 and 8 and its yellow


Column I = The Random date


Column F = Conditional formatting if M<8 its red and if M is between 30 and 8 and its yellow(same for column M)


It works fine.


I would like to have a button that will add a blank row below the row I’m working in and input the formula and conditional formatting accordingly. I have tried to record a macro and searched for advise but have had no luck. I hope you can help.

 

 

2 Replies

Could this not be done with a Table (ctrl+t) rather than VBA?

 

If you have a table with formula and/or conditional formatting in it, when you insert a new row it would inherit those formula and formatting.