+ Reply to Thread
Results 1 to 18 of 18

How to edit macro for auto-fill?

  1. #1
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    How to edit macro for auto-fill?

    I'm using 2 macros for auto-fill data and both work fine, but I have problem when I had only one row? Could you please give me some advise how to change these codes?

    Thank you in advance!

    Code 1

    Please Login or Register  to view this content.
    Code 2

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    How I usually do this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Quote Originally Posted by JBeaucaire View Post
    How I usually do this:
    Please Login or Register  to view this content.
    I am going to check this right now

  4. #4
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Quote Originally Posted by toci View Post
    I am going to check this right now
    I have 3 Columns for auto-fill (ET,EU and EV). Have a problem with this code on EU column? Any idea?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    Please stop using the REPLY WITH QUOTE button. Use the REPLY button or the QuickReply box below. Thanks.

    What seems to be the problem?

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    The last one works well when I have only one row, but if I have more than one, it doesn't work. I need macro which will auto-fill formulas up to the last row. That is, if I have only one row, auto-fill it. If I have e.g. 100 rows, auto-fill Columns ET, EU and EV up to the end.
    Last edited by toci; 10-27-2015 at 09:15 AM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    I don't understand the problem you're having. I use the code suggested, similar, over and over in macros daily.

    The line of code that is setting the LR variable, be sure to use a column that will always have data in it for every row. I usually use column A. Do you need to change that to column A?

  8. #8
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    My last 3 Columns are ET, EU and EV. In "ET" Column I have function =LEFT. In "EU" an "EV" Columns =VLOOKUP based on values from "ET". So, I need to populate data in that Columns. When I put your last code in macro, it fills me only range ET2:EV2, and my range is e.g. A1:EV150? Therefore, macro doesn't want to fill down other cells.
    Column A is quite good for condition as I have always data in that column.
    Last edited by toci; 10-27-2015 at 12:11 PM.

  9. #9
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Please Login or Register  to view this content.
    This is my macro I use on daily basis. How to edit it so when I have only ONE row in range A1:EV2 to auto-fill it. With this code (macro), when I have only one row, auto-fill function (Offset...) is going up to last cell in excel file and than i need do delete it manually. I hope so that now is a more clearer.
    Thanks for all your efforts!

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    I suggested you change the LR line of code to use column A, but in your example above I still see you have it set to "ET".

  11. #11
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    I've changed like this:

    Please Login or Register  to view this content.
    But still nothing. It populated only range ET2:EV2.
    Last edited by toci; 10-27-2015 at 02:44 PM.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    Maybe add a popup after the LR
    Please Login or Register  to view this content.
    Would be interesting checking different columns until you find the one that actually finds the REAL last row. The code is correct, I haven't seen your data, but I'm guessing it's not what you think.

  13. #13
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    I've edited a little my Report, and you can check this example. As you can see macro doesn't want to fill down all cells in Column G.
    Attached Files Attached Files

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    Your version of the full macro had you trying to first copy down a formula you hadn't even inserted until much later in the macro. Must do things in the correct order.

    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Yes, this is what I need!
    Thank you very much for all efforts that you put on this problem!

  16. #16
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Sorry, but one more question, please. :D
    I've attached the example.
    As you can notice this table has blue-white Style. When I run macro, how can I get the same Style in Column G ( blue-white, blue-white and so on)?

    Once more again, Thank you!
    Attached Files Attached Files

  17. #17
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to edit macro for auto-fill?

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    11-03-2014
    Location
    Belgrade
    MS-Off Ver
    2010
    Posts
    348

    Re: How to edit macro for auto-fill?

    Thanks a million!!!

+ 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. macro to bring up stored workbook, auto save to a new folder, then auto fill
    By Rick23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-29-2014, 06:58 PM
  2. [SOLVED] Edit Macro to Auto Populate Formula's
    By Cansa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2013, 06:26 PM
  3. Can't edit macro with auto open and auto close.
    By lpete in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-03-2012, 07:25 PM
  4. Macro to auto enter password to Edit
    By peterwithingtonuk in forum Excel General
    Replies: 3
    Last Post: 11-25-2010, 08:48 AM
  5. using auto fill edit or fill handel
    By fill handle or auto fill in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-10-2006, 03:10 PM
  6. [SOLVED] Edit Fill Series - How do I fill using minute increments
    By IUnknown in forum Excel General
    Replies: 1
    Last Post: 01-29-2006, 08:55 AM
  7. [SOLVED] Macro for Auto Fill
    By carolini in forum Excel General
    Replies: 2
    Last Post: 12-06-2005, 05:15 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