Seqentual number save

  • Thread starter Thread starter Peter Finlay
  • Start date Start date
P

Peter Finlay

Hi All,

I am designing a "Non-Conformance report" from word. I'd like my team
members to open this file, type the information in, automatically print
after the last cell has been selected, then save automatically (as the next
sequential number we actually type into the report) and saved in the folder
where the reports are stored.

eg. therefore, if we enter a number, say 1111, into the "report #" field I
would like the file to be saved as NonCon1111.doc. Would anyone be able to
help create this macro? (please keep in mind that my computer programming
skills arn't as great as everyone else's in here!

Thankyou everyone.

Please reply to (e-mail address removed)

Kind regards

Peter Finlay
 
Peter,

This sounds like this should do it.

Firstly, put this code into a standard code module in the Personal.xls
workbook, (go into the VBE, Alt-F11, select Personal.xls, and insert a code
module, Insert>Module) and copy this code in

Sub WbSave()
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs Filename:="NonCon" & .Worksheets("Sheet1").Range("report
#").Value & ".xls"
End With
Application.DisplayAlerts = True
End Sub

Then we will add a button to the toolbar. Go to
Tools>Customnize>Coimmands>Macros and drag the smiley face onto an existing
toolbar. Right-click the icon, and assign the newly created macro. The
picture can be changed to your design.

If many team members are to use this, you will need to repeat this on each
machine.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Would this also work for word??











Bob Phillips said:
Peter,

This sounds like this should do it.

Firstly, put this code into a standard code module in the Personal.xls
workbook, (go into the VBE, Alt-F11, select Personal.xls, and insert a code
module, Insert>Module) and copy this code in

Sub WbSave()
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs Filename:="NonCon" & .Worksheets("Sheet1").Range("report
#").Value & ".xls"
End With
Application.DisplayAlerts = True
End Sub

Then we will add a button to the toolbar. Go to
Tools>Customnize>Coimmands>Macros and drag the smiley face onto an existing
toolbar. Right-click the icon, and assign the newly created macro. The
picture can be changed to your design.

If many team members are to use this, you will need to repeat this on each
machine.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

field
 
In principle yes, but obviously there is no activeworkbook (don't know the
word equivalent, something like activedocument).

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top