Set serial number base on date and starting
Solved/Closed
Related:
- Driver detective serial number
- Driver detective - Download - Cleaning and optimization
- Dshidmini driver - Download - Gaming tools
- Ac97 driver - Download - Drivers
- Nvidia driver detect - Guide
- Serial number generator excel - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
3 Jul 2012 à 10:30
3 Jul 2012 à 10:30
Hi Sam,
Assuming your LPO serial is in cell A1, otherwise change the reference in the code. Implement the following code:
Code needs to be pasted under ThisWorkbook.
Now give the print order and see if the result is the right one.
Best regards,
Trowa
Assuming your LPO serial is in cell A1, otherwise change the reference in the code. Implement the following code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim FP As String
Dim SP As Integer
Application.EnableEvents = False
Cancel = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1
FP = Left(Range("A1"), 13)
SP = Right(Range("A1"), 3)
Range("A1").Value = FP & SP + 1
Application.EnableEvents = True
End Sub
Code needs to be pasted under ThisWorkbook.
Now give the print order and see if the result is the right one.
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
10 Jul 2012 à 10:27
10 Jul 2012 à 10:27
Hi Sam,
To get the year and month automatically try this formula:
="SWM/SB/"&YEAR(TODAY())-2000&"/"&IF(MONTH(TODAY())<10;"0"&MONTH(TODAY());MONTH(TODAY()))&"/125"
Just to be clear, this formula can be placed in any cell. Just make sure the cell reference in the code (3x A1) is the same as the cell you chose to put the formula in.
Best regards,
Trowa
To get the year and month automatically try this formula:
="SWM/SB/"&YEAR(TODAY())-2000&"/"&IF(MONTH(TODAY())<10;"0"&MONTH(TODAY());MONTH(TODAY()))&"/125"
Just to be clear, this formula can be placed in any cell. Just make sure the cell reference in the code (3x A1) is the same as the cell you chose to put the formula in.
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
12 Jul 2012 à 09:31
12 Jul 2012 à 09:31
Hi Sam,
Could it be because I forgot to replace ; with ,?
Regards
Could it be because I forgot to replace ; with ,?
Regards
3 Jul 2012 à 23:36
Thanks a million for your support. I did as you said. but it didn't work out. I'm not expert in this. Do i have to type SWM/SB/12/07/125 in A1 Cell or only SWM/SB/ because I need your VB extract month and day from system. Please let me know.
Thanks a lot again for ur help
Sam
4 Jul 2012 à 07:15
Thanks it's working properly.
4 Jul 2012 à 07:22
I need Year and Month automatically pick in system. pls help.