Set serial number base on date and starting
Solved/Closed
Related:
- Set serial number base on date and starting
- How to set auto redial on android - Guide
- How to set whatsapp date and time - Guide
- Nic serial number - Guide
- Winrar set password not working - Guide
- How to set viber offline - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jul 3, 2012 at 10:30 AM
Jul 3, 2012 at 10:30 AM
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 September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jul 10, 2012 at 10:27 AM
Jul 10, 2012 at 10:27 AM
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 September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Jul 12, 2012 at 09:31 AM
Jul 12, 2012 at 09:31 AM
Hi Sam,
Could it be because I forgot to replace ; with ,?
Regards
Could it be because I forgot to replace ; with ,?
Regards
Jul 3, 2012 at 11:36 PM
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
Jul 4, 2012 at 07:15 AM
Thanks it's working properly.
Jul 4, 2012 at 07:22 AM
I need Year and Month automatically pick in system. pls help.