+ Reply to Thread
Results 1 to 6 of 6

autofill help

  1. #1
    Registered User
    Join Date
    04-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2011
    Posts
    12

    Unhappy autofill help

    Hi, newbie here. need some help with autofill.im doing a spreadsheet where the user will enter a start and end date,for example, start date 1/1/14 end date 31/1/14. as there are 5 weeks between 1 jan to 31 jan, so the autofill will be for 5 column,if the date difference is 7 weeks, the autofill will be for 7 column.get what i mean?im using

    Sub getdate()
    Dim Ans1 As Date
    Dim Ans2 As Date
    Do
    Ans1 = InputBox("Please enter the start date", "MM/DD/YY")
    Loop Until IsDate(Ans1)
    Do
    Ans2 = InputBox("Please enter the end date", "MM/DD/YY")
    Loop Until IsDate(Ans2)
    ActiveSheet.Range("B4").Value = Ans1
    ActiveSheet.Range("B5").Value = Ans2
    End sub

    to prompt the date from the user.but im stuck at how to autofill according to the number of weeks.get what i mean?thank you in advance!
    Last edited by amirul; 04-13-2014 at 08:40 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: autofill help

    try this macro and if necessary mdify


    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Registered User
    Join Date
    04-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2011
    Posts
    12

    Re: autofill help

    somehow there is an error when compiling this code.i have no idea

  4. #4
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: autofill help

    Hi My Friend

    This is my First VBA solution. Please consider experts' solutions first before mine

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Appreciate the help? CLICK *

  5. #5
    Registered User
    Join Date
    04-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2011
    Posts
    12

    Re: autofill help

    thank you az-xl!

  6. #6
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: autofill help

    Quote Originally Posted by amirul View Post
    thank you az-xl!
    Is it what you want? Or you were expecting another answer? You didnt say anything.

+ 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. [SOLVED] Very small AutoFill macro showing "AutoFill methode of range class failed" why ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2013, 10:21 PM
  2. Replies: 0
    Last Post: 09-17-2012, 08:24 AM
  3. Macro for Autofill removes header info when there is no data to autofill
    By esturan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 01:42 PM
  4. Replies: 1
    Last Post: 06-17-2005, 04:05 PM
  5. Replies: 0
    Last Post: 03-02-2005, 12:06 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1