LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Dates and VBA Magic!

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDE add-on VB Magic? peterv Excel Discussion (Misc queries) 1 March 10th 06 11:34 PM
My new book is available -- "This isn't Excel, it's Magic" Bob Umlas Excel Discussion (Misc queries) 1 September 10th 05 04:21 AM
Magic Cells Jacob_F_Roecker Excel Discussion (Misc queries) 7 July 23rd 05 10:04 PM
Macro Magic Wand Gordon[_12_] Excel Programming 5 August 6th 04 04:34 PM
Magic Shrinking Listbox Patrick Molloy Excel Programming 1 July 22nd 03 12:00 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"