days of year

cyborgt100

New Member
Joined
Mar 27, 2019
Messages
6
hi guys having problem i trying create a code so depend on what day it is the code change
prefix is L and the next two number is YY year and the 3 last numbers is DDD (001 - 366) but in number format not words like Sun or Mon so in the case than 366 would be Feb 29 or 206 would be 25 of july. i try vlookup table but it did work either


Code:
Sub LotNumbers()


Result = MsgBox("Do you need a lot number?", vbYesNo + vbQuestion)
If Result = vbYes Then
Range("J6").Select
Selection.Font.Color = vbGreen
Selection.Font.Bold = True
dates = Format(Now, "dd,mmm")
Range("J6").Value = "L" & Format(Now, "yy")  & Format(Now, "ddd")
MsgBox "lot number complete "
Else:
Range("J6").Clear
MsgBox "You have No to lot number"
End If
End Sub

all help would be create
 
Have you created a function called year?
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top