+ Reply to Thread
Results 1 to 7 of 7

Calendar using VBA scripting

  1. #1
    Registered User
    Join Date
    09-20-2009
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Calendar using VBA scripting

    Hi,

    My wife uses an Excel spreadsheet for her Home Education planning, but each month I have to print the next month out and manually change the dates.

    She uses Monday to Friday evrery week, so what would be the script to ask for the date you want the calendar to start from and then how many months and the pages are then created using that information.

    Many thnaks for any suggestions.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Calendar using VBA scripting

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-20-2009
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar using VBA scripting

    Hi,

    Thanks for responding.

    I have attached a mock up, I've added a comment which I hope explains better what I'm trying to get.

    Cheers.
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Calendar using VBA scripting

    Use this macro to set the starting date:

    Please Login or Register  to view this content.
    change J2 to read = D2 +1 and then change O2 to read J2 +1, etc. This will give you a template you can use over and ove.r

  5. #5
    Registered User
    Join Date
    09-20-2009
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Calendar using VBA scripting

    Thanks for the help!

    I'm beginning to understand script and can 'read' what's going to happen. My problem is I don't where to paste the code, I can open editor but does it need to go in the workbook or Sheet1. I have put it in both places but the prompt doesn't come up.

    I've added a button instead and the wife can at least press the button to call your date script.

    Much thanks again.
    Last edited by alex.ransome; 01-05-2015 at 10:48 AM.

  6. #6
    Forum Contributor
    Join Date
    12-24-2014
    Location
    little ole England
    MS-Off Ver
    2013
    Posts
    116

    Re: Calendar using VBA scripting

    hiya

    am attaching a file i am currently working on for a similar problem

    it is not a direct solution to your problem but might help with ideas

    note all the VBA is unprotected so you can copy paste edit any of it

    this version creates today and the next 6 days on opening the workbook

    the master sheet is what is used as template for creating new

    ( and a lot of thanks from members here for getting me this far)
    Attached Files Attached Files
    ◄Ŧя?μвŁ?►
    By Name & By Nature

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Calendar using VBA scripting

    @alex.ransome

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dynamic Code Generator
    By samantha_S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2013, 12:48 AM
  2. Scripting
    By prettywoman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2011, 03:21 AM
  3. VBA Scripting Help!!
    By hnoshea in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-17-2006, 12:14 AM
  4. [SOLVED] SCRIPTING
    By APC25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2006, 03:35 PM
  5. Is scripting the way to go here?
    By LKG in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-09-2005, 03:05 PM

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