+ Reply to Thread
Results 1 to 6 of 6

Automate Down Fill VBA

  1. #1
    Registered User
    Join Date
    08-13-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    3

    Automate Down Fill VBA

    I know there has been subjects written about this but I'm still having a few issues. I am looking for a code that will down fill a range of cells in a row if a user enters values in the adjacent five cells. I need this to be automated so I don't have to run the macro every time.

    An example is that if I enter values into cells B5:F5, I want macro to automatically down fill formulas into cells G5:J5. Only when all 5 cells have a value can the macro run and if I accidentally delete a cell from B:F that had previously been filled, I don't want the macro to break and yell at me.

    Is this possible?

    I have some knowledge with VBA but definitely probably run through too many hoops to get what needs to be done. My guess is I'll be using a combination of private and public macro.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Automate Down Fill VBA

    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
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Automate Down Fill VBA

    Why the need for macros for this? You could probably do this with a simple formula...

    B
    C
    D
    E
    F
    G
    5
    1
    Your Formula
    6
    2
    Your Formula
    7
    3
    Your Formula
    8
    4
    Your Formula
    9
    5
    Your Formula


    B
    C
    D
    E
    F
    G
    5
    1
    6
    2
    7
    8
    4
    9
    5


    G5=IF(COUNTA($B$5:$B$9)=5,"Your Formula","")
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    08-13-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    3

    Re: Automate Down Fill VBA

    Hi Ford - Really appreciate the thought. The reason I don't want to use formulas is I want the cells blank prior to you filling in the 5 user defined cells. I may use words/dates/numbers and dont want anything to muddling up the sheet. All in all, what I'm looking for is if someone was filling out a form with 5 variables, they wouldn't need to drag down formulas above and there wouldn't be anything in the formula cells until you've entered those five things. Lastly, once entered it be great if the macro would "recognize" the conditions have been filled and then would down fill automatically.

    Please see the attached. I have given a very simple down example. If you run the macro it'll populate cell G5 and H5 but I am hoping to automate this to populate once you've typed in the word "No" in F5.

    I hope this clarifies and thanks again for your help.
    Attached Files Attached Files

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Automate Down Fill VBA

    I used COUNTA() because that will count anything you enter, so you can still use the formula, so the formula, based on your sample, would be...
    G4=IF(COUNTA($B$4:$B$8)<>5,"",F5&" on "&TEXT(C5,"MM/DD/YYYY")&" I ate "&B5&" pizzas and "&D5&" burgers "&E5)
    copied down.

    Try it and see

  6. #6
    Registered User
    Join Date
    08-13-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    3

    Re: Automate Down Fill VBA

    I definitely get it, was just looking for something a little cleaner. But I may turn that way if I can't figure it out! Cheers for the help.

+ 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. How to color-fill blank cells, then once data is entered cell is no-fill
    By hatemail13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 07:57 PM
  2. Formula to Automatically Fill Blank With Next fill cell's data?
    By VMoney in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-22-2013, 05:11 PM
  3. Replies: 1
    Last Post: 09-07-2011, 05:57 PM
  4. VBA Code to Automate Series of Cell Fill Color
    By Mark21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2011, 08:05 PM
  5. Replies: 0
    Last Post: 04-06-2009, 04:07 PM
  6. Replies: 1
    Last Post: 07-13-2007, 10:59 AM
  7. [SOLVED] Fill in form to type Item descrictions and costs and fill in funct
    By cradino in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-16-2006, 03:45 PM
  8. Replies: 1
    Last Post: 09-17-2005, 10:05 AM

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