+ Reply to Thread
Results 1 to 11 of 11

VBA and Input Box Scenario

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    VBA and Input Box Scenario

    I need an input box that can extend a monthly timeline into X amount of months that I wish to have extended from any date, (past, present, or future)

    Can someone please help guide me in the right...
    Last edited by bburrus; 05-14-2013 at 09:08 AM.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    For the month indicator

    Please Login or Register  to view this content.
    A1 = start month
    B1 = end month

    Using A3 =A1 and D1 as formula above

    Please Login or Register  to view this content.
    Last edited by humdingaling; 04-30-2013 at 08:33 PM. Reason: corrected cell reference

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    apologies
    had wrong cell reference

    I've put what the code into the attached file

    seems like you have changed your initial request though...so do not know if it is longer valid
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    Please Login or Register  to view this content.
    you really shouldn't change initial post and request
    this thread would not make any sense if they were to follow it

    Amended Macro to your new request

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    Hi bburrus

    unless its highly private, please request help in the forums instead of PM
    How am I able to apply that to different tab within the worksheet. I get what it does but I can't put Start Date and End date in every tab. I have multiple timelines on each tab and they all end end at different dates so I'll have to extend them out on various dates from where they end.

    with the above method written macro (not the sample) you do not need to put in start or end date
    it works off basis whatever cell (4,1) aka A4 is and your inputbox is how many months it extends

    if your multiple sheets all have date on a4 then you can just loop the whole For....Next section and you can cycle through worksheets with
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VBA and Input Box Scenario

    So from this VBA you gave me:

    Please Login or Register  to view this content.
    This has the macro running for A4. I need the macro to run the timeline on any selected cell because my timelines are placed at different dates (rows) and extend to different columns. I want to be able to click on the last date of the timeline and click run macro and put in how many months I want to run the timeline to from the end of the last date.
    Last edited by Leith Ross; 05-03-2013 at 03:55 PM. Reason: Added Code Tags

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    Hi bburrus

    so you only want a macro to add "x" amount months to cell you have selected on the current sheet only or on subsequent sheets?
    please be very specific

  8. #8
    Registered User
    Join Date
    04-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VBA and Input Box Scenario

    On subsequent sheets. There are timelines on most tabs in my workbook and they are all formatted differently. The timelines start and end on different cells depending on the tab they are located on. I just want to be able to choose any sheet. Go to the last date on that timeline. Enter the amount of months I wish to extend the timeline from the selected cell. and have it extend.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA and Input Box Scenario

    Hello bburrus,

    To better understand your problem, it would help if you attach your workbook for review. Please include some before and after examples of what you the macro to do.

    To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.

    File Manger Picture
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  10. #10
    Registered User
    Join Date
    04-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VBA and Input Box Scenario

    For those following and trying to solve, I posted an example template below. The first tab is just a general layout BUT DOES NOT APPLY TO THE WHOLE WORKBOOK. The second tab is explaining what I am trying to do.

    Thanks for your help!
    Attached Files Attached Files
    Last edited by bburrus; 05-14-2013 at 09:08 AM.

  11. #11
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: VBA and Input Box Scenario

    Based on your example

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1