Hi All
I'm new to forums, so I'll give it a go
I've written a workbook for one section of PAS 2030 for my friends business to help him out. I can get everything working but am now stuck. I'm not bad with excel as I've been using it for 20 years or so to run small jobs.
Basically would like to do is have a job template that has a macro to:
could someone out there stop from going bald please as I'm pulling my hair out. i look at some of the Macros and my mind boggles!
I've been trying the macro below but for some reason it will not work and keeps coming up with an error. This macro doesn't even cover the locking of the file when it's save I know, so if someone could help with that I'd be eternally grateful
Sub nextjob()
Range("g26").Value = Range("g26").Value + 1
Range("g6:g10").ClearContents
End Sub
Sub SaveNextJobWithNewName()
Dim NewFN As Variant
'Copy Job to new workbook
ActiveSheet.Copy
NewFN = "c:\desktop\Job Folder\Job" & Range("g26").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
nextjob
End Sub
Many thanks in anticipation
Cheers
Paul
I'm new to forums, so I'll give it a go
I've written a workbook for one section of PAS 2030 for my friends business to help him out. I can get everything working but am now stuck. I'm not bad with excel as I've been using it for 20 years or so to run small jobs.
Basically would like to do is have a job template that has a macro to:
- increment the job numbers (done this before and had it working loads of times)
- clear out the name and address cells each time the number is increased (done this before and had it working loads of times)
- save the completed spread sheet to a folder on the desk top (never done this before!)
- the completed sheet needs to be locked for auditing purposes (never done this before!)
could someone out there stop from going bald please as I'm pulling my hair out. i look at some of the Macros and my mind boggles!
I've been trying the macro below but for some reason it will not work and keeps coming up with an error. This macro doesn't even cover the locking of the file when it's save I know, so if someone could help with that I'd be eternally grateful
Sub nextjob()
Range("g26").Value = Range("g26").Value + 1
Range("g6:g10").ClearContents
End Sub
Sub SaveNextJobWithNewName()
Dim NewFN As Variant
'Copy Job to new workbook
ActiveSheet.Copy
NewFN = "c:\desktop\Job Folder\Job" & Range("g26").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
nextjob
End Sub
Many thanks in anticipation
Cheers
Paul