Clear cells in workbook while leaving Formulas and headers intact

Raedars

New Member
Joined
May 29, 2019
Messages
2
I currently use Excel spreadsheet to enter time sheets before I send them off to be processed. I currently use the current week time sheet (adding and deleting employees as needed) - and then after I enter the weekly time I save as the current week but use SAVE as new workbook and clear cells indivudually as required to use as a blank template for the following week.

Is there a way to Mass clear only some spreadsheet cells while leaving the cells with Pertinent Employee info along with formulas for calculations alone?

I tried to write a code to clear cell contents in specific ranges , however since the number of rows in my worksheet change constantly - i am deleting rows that I need and not deleting those that I dont.

Sample below :
i require all the cells in BLACK to remain unchanged and the cells in RED to be cleared. Is this possible? is there a code I would write to make this happen?
Note: Protecting sheet / cells seems to be ineffective so far.





EE EMPLOYEE NAMEPAY RATELAC CODE EREOTEDTEREOTEDTEREOTEDTEREOTEDTEREOTEDTEREOTEDTEREOTEDTEREOTEDTTOTAL$$
No#C/ILASTFIRST& UNION& LEVELJOB #DIM CODE11.5211.5211.5211.5211.5211.5211.52ER-1EOT - 1.5EDT-2HOURS
B1314IBISHOPFRANK $ 30.00 L1034 BISHOPEE- Sub T0.000.0010.000.000.0010.000.000.000.008.000.000.009.500.000.000.000.000.000.0010.000.0017.5010.0020.0047.50LOA
51303949NTX-LOA 10.00 10.00 10.00 $585.00
61307451NTX-LOA 8.00 9.50 $341.25
-NTX-LOA $0.00
-NTX-LOA $0.00
- NTX-LOA $0.00
TRAVEL JM GEN DIM
WK TOTAL HRS:47.50 INDUSTRIAL 51303949PLC 9.50 9.50 0.000.0019.0019.00
51303949PLC-SFJ 0.50 0.50 0.000.001.001.00
61307451PLC-X 8.00 9.50 10.00 17.5010.000.0027.50
0.000.000.000.00
0.000.000.000.00
0.000.000.000.00
0.000.000.000.00
0.000.000.000.00

<colgroup><col><col><col><col><col><col><col><col><col span="21"><col span="3"><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Do the cells in red font hold constants and all the others (except the headers) formulas? Are the headers all in the same row? If yes, which row is that?
 
Upvote 0
Here's a trick I learned. Put a conditional formula in the cells you want to routinely clear. After you highlight the values you will clear, click the Home tab, click Conditional Formatting drop down, then New Rule, then OK. That will apply a conditional formatting that does nothing to the formatting.

When you're ready to clear those cells, click the Home tab, in the Editing Group, click the Find & Select drop-down, then click Go To Special. In the dialog box that opens, select Conditional Formatting. All of the cells you want to clear are now selected (highlighted). Click the Clear drop down in the same group and select Clear Content. That should do it. If you add new employee rows, make sure to select a row that contains an existing employee, <ctrl>+<c> to copy, then select the row of the new employee and Paste Special Formats. That way, their data will contain the conditional formatting and will be selected with the Go To Special trick.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top