Results 1 to 4 of 4

Thread: How to Create Calendar in Excel

  1. #1
    Join Date
    Dec 2011
    Posts
    49

    How to Create Calendar in Excel

    Recently I was trying to create the macros that result the Calendar, which means to say that I just trying to create the calendar in excel. But however I fail to create it, I have tried my best to create the calendar in excel but still not able to create the simple format calendar. So if you guys have any ideas for creating the calendar in the Excel then please do the reply. Your reply will be thanks and appreciated.

  2. #2
    Join Date
    Jul 2011
    Posts
    623

    Re: How to Create Calendar in Excel

    According to my information this is simple to create the calendar in excel, so for that you just have to make the use of the loop so that it will increment the values of each cell. This is simple logic for the creation of the calendar in excel for that; take the two different variables one with the initial value of the first days of the next month, and the other with the first day of the current month.
    After that make use of “for loop”, to repeat the execution of the instruction.
    So, the variable that have to be initialize are as follow
    “a= 1st day on next month, b=1st day of current month.

    Then the Macros will be
    For x = 1 To (a - b + intDayofWeek - 1)
    If x >= intDayofWeek Then
    .Range("cellColumn:cellRow")(x) = x - intDayofWeek + 1

    Next x

  3. #3
    Join Date
    Aug 2011
    Posts
    695

    Re: How to Create Calendar in Excel

    There I think that you have to set the variable’ f_dt’ so that you can calculate the first day of the next month.
    f_dt = DateSerial(CurYear, CurMonth + 1, 1)
    Now you have to place “1” in cell position of the first day,
    ‘Then make the use of the ‘Select Case’ for making the case for the DayofWeek.
    Select Case DayofWeek
    Case 1
    Range("a3").Value = 1
    Case 2
    Range("b3").Value = 1
    Case 3
    Range("c3").Value = 1
    Case 4
    Range("d3").Value = 1
    Case 5
    Range("e3").Value = 1
    Case 6
    Range("f3").Value = 1
    Case 7
    Range("g3").Value = 1
    End Select

    ‘Now you have to make use of the loop,

    For Each cell In Range("a3:g8")
    RowCell = cell.Row
    ColCell = cell.Column
    If cell.Column = 1 And cell.Row = 3 Then
    ElseIf cell.Column <> 1 Then
    If cell.Offset(0, -1).Value >= 1 Then
    cell.Value = cell.Offset(0, -1).Value + 1
    If cell.Value > (FinalDay - StartDay) Then
    cell.Value = ""
    Exit For
    End If
    End If
    ElseIf cell.Row > 3 And cell.Column = 1 Then
    cell.Value = cell.Offset(-1, 6).Value + 1
    If cell.Value > (FinalDay - StartDay) Then
    cell.Value = ""
    Exit For
    End If
    End If
    Next
    May this will help you out to create the working macros.

  4. #4
    Join Date
    Aug 2011
    Posts
    540

    Re: How to Create Calendar in Excel

    According to my suggestion you must try this macros, may this will works for creating the macros in excel that you wish to create.

    sub abc()
    ab = [A7:G12]

    For j = 1 To [A7:G12].Count
    ab(((j - 1) \ 7) + 1, (j - 1) Mod 7 + 1) = DateSerial(2011, 12, 1) - DatePart("w", DateSerial(2011, 12, 1), 2) + 7 * ((j - 1) \ 7) + (j - 1) Mod 7 + 1
    Next

    [A7:G12] = ab
    end sub

Similar Threads

  1. Replies: 2
    Last Post: 07-02-2012, 07:50 PM
  2. Cannot Create Multiple Calendar on iCloud?
    By Jalela in forum Technology & Internet
    Replies: 7
    Last Post: 18-06-2011, 09:24 PM
  3. How to Create an Advent Calendar with JavaScript?
    By MELTRONICS in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 03:05 AM
  4. Create a calendar always visible on my PC?
    By migons in forum Windows Software
    Replies: 5
    Last Post: 04-02-2010, 10:46 PM
  5. How to create Calendar in C#
    By Jacek01 in forum Software Development
    Replies: 4
    Last Post: 07-06-2008, 04:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,946,259.56071 seconds with 17 queries