+ Reply to Thread
Results 1 to 4 of 4

Update a calendar

  1. #1
    Registered User
    Join Date
    07-07-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    24

    Update a calendar

    I've been using a spreadsheet for many years now to keep track of my finances, to-do lists, and several other things. It dawned on me last night that I could make my life much easier if I automated some of this, but I haven't been able to make much progress.

    I attached a sample of the calendar I want to work with. It has 7 columns - one for each day of the week - and 7 "rows" - a group of 6 rows per day. Each day also has a date above it that will change color via conditional formatting based on the current date.

    Here is what I want to do and haven't been able to implement with VBA:

    When I push the "Update Calendar" button, if the current day is not in the first row of days, I want to move all of the information in each row of days to the one above it.

    As an example, today is December 29th, so cell D3 should be pink as it is the current date. The text in the section under it for that day is "Message C1". Now imagine today is January 5th. The text in the section under D10, the cell with January 10th in it, is "Message C2". Since the current day is no longer in the first row of days, I want to be able to push the "Update Calendar" button and have the following things happen:

    The dates in the first row of days need to be changed to make the current day in the first row instead of the second row. All of the accompanying messages need to be moved up as well, e.g. "Message A2" should now be in cell B4 instead of B11, "Message F4" should now be in cell G18 instead of G25, etc.


    The VBA code I've been messing with is included in this spreadsheet, but so far I've gotten almost nothing accomplished as I can't get Find() to locate the cell with the current date in it. Any help anyone can give me would be much appreciated. I want to learn how to do this so I'm not asking anyone to just do it for me.
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Update a calendar

    Not clear what you are doing, but I would have a data worksheet in a table format & use VLOOKUP to populate the calendar from the data worksheet. I've added a very quick example
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-08-2007
    Posts
    93

    Re: Update a calendar

    See how the attached works for you.

    SAE
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,522

    Re: Update a calendar

    Quote Originally Posted by seckert View Post
    See how the attached works for you.

    SAE
    I have found this solution very useful as I too have a similar query for Updating a Calendar with Holidays and other Occassions..
    Last edited by e4excel; 10-06-2011 at 03:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1