dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,373
- Office Version
- 365
- 2016
- Platform
- Windows
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.
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.