"Dave O" wrote:
> That's exactly right. I'll be saving it under the actual job number and email that sheet to specified depts where it will be opened and changes may be made and saved again. The next time I open the original template it will be for a different job. I hope this clarifies it a bit.
"Dave O" wrote:
> Yes. The sheet just has basic headings ie Job #, Date, Show name etc. that are completed every time I fill it out.
"Dave O" wrote:
> Forgot to mention: I need the tab name and cell address, too.
>
> I don't know if this is what you're referring to but I-3 is where the Job number would be. Is that right?
1. Open the template and create a named range called JobNumber (spelled
just like that) by clicking on the menu *Insert *Name *Define. In the
top box type JobNumber and in the bottom box type =930 (or whatever
your current job number is). Click OK.
2. In cell I3, the job number cell, enter the formula =JobNumber and
the current job number will appear.
3. With the template showing on screen, press ALT-F11 to display the
Visual Basic editor. There is a project pane on the left side of the
window; in that pane your template's file name is displayed in bold
font. Below that is an icon for This Workbook. Right-click This
Workbook and select View Code. Copy and paste this code into the pane
on the right:
Private Sub Workbook_Open()
If Range("sheet1!c3").Value = "" Then Names("JobNumber").Value =
Evaluate(Names("JobNumber").Value) + 1
End Sub
4. Notice this part of the code: Range("sheet1!c3")
Change the sheet1 to match the tab name of your sprdsht, and change c3
to the client name's cell or another cell that is blank in the template
but that will be filled in for a job.
5. Note the job number displayed in I3, save the file, close it, open
it again, and you should see the job number has incremented by one.
6. Fill in a dummy name or whatever in the cell you indicated in step
4, save the file as though it was an actual job, and reopen. You
should see the job number has NOT incremented by one.
Let me know how it goes!
Make sure this is all on one line in the Visual Basic editor.
"Dave O" wrote:
> IT WORKED! IT WORKED! Thank you so much. You've lifted a great burden off my shoulders.