+ Reply to Thread
Results 1 to 13 of 13

Dynamic Update macro for autofill, rank, sum, large /w example

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Dynamic Update macro for autofill, rank, sum, large /w example

    Hey,

    I'm trying to create an update button to dynamically input a series of macros based on a bunch of rows at the top of the sheet... here it goes explaining each part

    • Formula
      The formula will always be located in row 10, it needs to autofill all the way down to the bottom of the sheet (end of column A)

    • Sum
      Uses the ranges in row 3 and row 4 for the start and end rows for the sum macro.

    • Large
      Same as sum but a large...

    • Rank
      - Same as large & sum but for a rank


    The macro should be able to work out what macro to run in each column by the text located in Row 1...

    I've attached an example which should clear it up a bit, with some macros to help... but I don't have the knowledge to make them work how I want them to...
    Attached Files Attached Files
    Last edited by Hyflex; 01-12-2012 at 09:09 AM.

  2. #2
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    I'm trying to get it to run in a simple for i = 1 to LC (last Column) but it's not working how I want it to, I tried just a bunch of if commands (i know there are better ways but I don't know how to do them either :S

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    hi Hyflex, please check attachment if it is sort of what you mean. I did not understand what calculations should trigger Formula wording so I just entered any values.

    Run code "main". The code for now checks values in "b1:b1, i1:l1" range that can be amended if required.
    Attached Files Attached Files
    Last edited by watersev; 01-06-2012 at 06:49 PM.

  4. #4
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Watersev, that is mighty impressive and so far looks incredible, I still can't work out what I was doing wrong when I tried but your one is significantly more advanced that what I was doing.

    For the Formula macro it should just drag/autofill from row 10 all the way down to the last row in that column.
    (I've attached an example)

    If Row 5 for each column has a true then after it has done whatever it needs to do in that row it should turn it the whole column into values.
    If Row 6 for each column has a true then after it has completed everything it should turn every column into values.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    please check attchment, code shortened and revised, run code "main"
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Hey Watersev, thank you very much for your help.

    I've edited your code below a fair bit, let me know if I've made any obvious errors.


    Please Login or Register  to view this content.
    Last edited by Hyflex; 01-12-2012 at 06:05 AM.

  7. #7
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Hey watersev,

    I've been playing around with it some more and it's pretty much done apart from one error now.
    In the Range("J27:J34") or Range("E27:E34") (last Dataset of any Sum Action) the values aren't correct and I can't work out why it's not calculating them.

    See attached for most update version:
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    can you provide example of SUM formula example for J13 as you would like it to be after the code execution?

  9. #9
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Hey,

    The formula for J13:
    Please Login or Register  to view this content.
    The formula for J14:
    Please Login or Register  to view this content.
    The formula works perectly fine for the first dataset (J13:J22) but for the second when it's turned into value's it doesn't work. If you set J5 and J6 to FALSE and run the macro they all work fine.

    EDIT: I just realised, Rank, Count and Large are doing the same thing (Only for the last dataset)
    Last edited by Hyflex; 01-10-2012 at 06:46 AM.

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    try tp replace this block:

    Please Login or Register  to view this content.
    to this one

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Hey, Thanks for your reply.

    The change you just made stops the macro from replacing the formula into values...

  12. #12
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    this line:
    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Dynamic Update macro for autofill, rank, sum, large /w example

    Thank you ever so much, this is working amazingly now and saves me so much time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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