Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I display calendar days in a row

How do I display calendar days in a row for a complete month instead of colums?
Need help with a customize function.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default How do I display calendar days in a row


Hi,
Dates are in UK (DD/MM/YYYY) format -


Sub TestDate()
Call DaysinMonth(9, 2005)
End Sub

Sub DaysinMonth(ByVal M As Integer, ByVal Y As Integer)

Dim c As Integer, lastDay As Integer

lastDay = Day(DateSerial(Y, M + 1, 0)) ' Calculate number of days in Month

Rows(1).ClearContents ' Clear row 1 of dates

Cells(1, 1) = DateValue("1" & Str(M) & Str(Y)) ' Set first day of month in A1
For c = 2 To lastDay ' Increment each day until end of month .. B1, C1 etc
Cells(1, c) = Cells(1, c - 1) + 1
Next c
End Sub

HTH

"Vern H." wrote:

How do I display calendar days in a row for a complete month instead of colums?
Need help with a customize function.

Reply
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
aging calendar days mmanis Excel Worksheet Functions 2 December 4th 09 07:07 PM
Counting calendar days musha-bsuha[_2_] Excel Worksheet Functions 3 December 3rd 09 11:19 AM
Calendar days D Excel Worksheet Functions 1 March 1st 07 08:24 AM
Calendar day not days skip New Users to Excel 2 September 22nd 06 11:16 PM
Calculating # of busn days, not just calendar days, between 2 dates? StargateFanFromWork Excel Programming 1 June 29th 04 08:31 PM


All times are GMT +1. The time now is 09:01 PM.

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

About Us

"It's about Microsoft Excel"