Formula being deleted

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
1,025
I have a spreadsheet that has a table in it with a formula in a hidden column for the table. I have a button to delete the records but if the row is highlighted and delete button pressed on the keyboard, the formula in the hidden column will be deleted. Is there a way I can add some vba code to insert the formula back in to each row within the table in column C?

The variables are:
Formula in column C in the table: =IF(A11="","",IF(COUNTIF(Sheet2!$G$87:$DO$97,A11),"Public_holiday",IF(WEEKDAY(A11)=1,"Sun",IF(WEEKDAY(A11)=7,"Sat","Business_day_rate"))))

Table name: css_quote

The formula does what is needed, I just need to know a way of making the formula get put back in if someone selects a row and presses delete on the keyboard instead of using the special buttons I have made.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
17,957
Office Version
2013
Platform
Windows
Why not protect the sheet to not allow row / column deletion.
Incorporate the protect / unprotect into your button code
 

Forum statistics

Threads
1,077,736
Messages
5,335,903
Members
399,056
Latest member
CityGirlLuv

Some videos you may like

This Week's Hot Topics

Top