Hi folks - looking for a bit of assistance with this one...
We have a requirement to print a sheet of bar code labels and attach to a pallet of stock before shipping. I have the bar code scanner and this inputs data into an Excel spreadsheet. I have developed a bit of code which will remove duplicate lines, select a range of cells, and print the workbook, which works OK.
I want to have the macro prompt the user to enter a file reference number (6 digit numeric),use this number as the file name of the workbook and save a copy of the file using this number in a network location (leaving the original file name and location as the working document).
Here's what I have:
'Prompt for dim sheet number
Dim Dimsheetnumber As Long
Dimsheetnumber = Application.InputBox("Enter the Dim Sheet Number", Type:=1)
' selectb1 Macro
Range("B1").Select
ActiveCell.FormulaR1C1 = Dimsheetnumber
Range("B2").Select
'Printout macro
Range("A2:B2").Select
Range(Selection, Selection.End(xlDown)).PrintOut
'Save a copy as Dimsheetnumber
ChDir _
"K:\Shipping\General Files\Bar Code Labels\Saved label sheets (Stored under dim sheet number)"
ActiveWorkbook.SaveAs Filename:= _
"K:\Shipping\General Files\Bar Code Labels\Saved label sheets (Stored under dim sheet number)\Dimsheetnummber.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
This works to a degree, but doesn't use the entered number as the file name, and also saves the original working document with the new name and new location.
I have attached the file also if this helps.
Thanks in advance as always,
J.
Bookmarks