Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mark
See if this works. My computer's date settings are norwegian, so I don't know how this runs in your country: Sub MakeMonth() Dim S As String Dim D1 As Date, D As Date Dim R As Long Dim i As Long S = InputBox("Enter month year, like """ & _ Format(Date, "mmm yyyy") & """:") If S = "" Then Exit Sub i = 0 Do i = i + 1 If i = Len(S) Then Exit Sub Loop Until Val(Mid$(S, i)) 0 S = Left(S, i) & " 15 " & Mid(S, i) If Not IsDate(S) Then Exit Sub D1 = DateValue(S) R = 6 For D = D1 To DateSerial(Year(D1), Month(D1) + 1, 14) Cells(R, 1).Value = Format(D, "mmm d dddd") R = R + 1 Next End Sub HTH. Best wishes Harald "tip2tail" skrev i melding ups.com... Hi all, Looking to be able to do some fancy jiggery pokery in Excel to make my life easier at work. I want to be able to input (or select) a month Jan - Dec and have Excell fill out rows downwards with the date and what day that is in the current year. Each month in my company starts on the 15th and ends on the 14th. An example thought process for this would be: Select October from the list box (if possible) or input the name/number (10) of the month. Again beside it input year(2005). Say this is in C4. The script in Excel would then say from row C6 onwards 15th oct 2005 is a Sat- Place "15th Saturday" in C6, "16th Sunday" in C7, 17th = Monday - Place "17th Monday" in row C8, "18th Tuesday" in C9 and so on until the 14th November - "14th Monday". Would this be possible to implement? You can e-mail me direct on mark AT {my nickname - see above} DOT co DOT uk if anyone wants more detail. Also post here. This is very important to myself and my small company. Thanks, Mark D Young |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IDE add-on VB Magic? | Excel Discussion (Misc queries) | |||
My new book is available -- "This isn't Excel, it's Magic" | Excel Discussion (Misc queries) | |||
Magic Cells | Excel Discussion (Misc queries) | |||
Macro Magic Wand | Excel Programming | |||
Magic Shrinking Listbox | Excel Programming |