Question Locked

Shared worksheet template

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
my group uses a shared worksheet on a network drive to keep track of field techs (dispatch). If I try to create a template that will create a new blank spreadsheet, it doesn't work. I've tried creating a macro in the template, no go. I can't reuse the old spreadsheet without a lot of work cleaning it out first, and besides, it's not elegant. Help!

2 replies

by rtfentem

I had a similar problem and I created a Custom button on the template that I use to clear the cells on the form.

Here is the code...one gatcha, if any of your cells are merged, you must use the range of the field. You need to replace "Sales Invoice" with the sheet that you want to clear. Remember that the ranges are for my sheet so make sure that you change them before you try it.

Sub CommandButton2_Click()

' Code to clear cells of old data
Sheets("Sales Invoice").[B7:C7, B9:C9, E9:F9, B10:C10, E10:F10, F12, B13:D13, F13:G13, B14:D14, F14:G14, B15:D15, F15:G15].ClearContents
Sheets("Sales Invoice").[B16:D16, F16:G16, B17:D17, F17:G17, B18:D18, F18:G18, A21:G21, A23:G23, A27:F27, A28:F28, A29:F29, A30:F30, A31:F31, A32:F32, A33:F33, A34:F34, A35:F35, A36:F36, A37:F37, G39, G41].ClearContents
End Sub

Hope this helps

Rhonda

This discussion is closed to new replies.