+ Reply to Thread
Results 1 to 4 of 4

Copy value & fill color and fill dynamically to last row of data

  1. #1
    Forum Contributor Webbers's Avatar
    Join Date
    09-06-2005
    Location
    Poinciana, FL
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    337

    Copy value & fill color and fill dynamically to last row of data

    Okay this is just so simple, but I cannot figure out how to do it. I tried the macro recorder, and aside from the garbage it produced, it had a defined range. The macro should place the X in cell CG1 and add the background color, then fill down to the last row of data. If a "helper" column is needed to determine what the last row is, that would be column C.

    1. I would like to use this macro for the Active worksheet (it will be used multiple times)
    2. The # of rows is dynamic (based on the sheets as well as each week the amount of data varies)
    3. The only content an X for the value in the cell and the fill color in Column CG
    4. The color index is 44 (orange), which I believe is the same as this: .Color = 49407 (either can be used)

    This is my recorded code. The macro works, the problem is the static range. This will not allow me to use it for multiple sheets, and the number of rows is different every week. Thanks in advance!

    Please Login or Register  to view this content.
    Last edited by Webbers; 08-06-2019 at 10:51 AM. Reason: added code
    ~*~ Sherry ~*~
    Poinciana, FL

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy value & fill color and fill dynamically to last row of data

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor Webbers's Avatar
    Join Date
    09-06-2005
    Location
    Poinciana, FL
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    337

    Re: Copy value & fill color and fill dynamically to last row of data

    JLGWhiz,

    Brilliant! I knew it was simple... I just simply could not get from point A to B. This one is going in my personal workbook for later too! I almost never work with a static range (or path/filename for that matter). Having the ability to do this and basically everything based on dynamic rows of data is essential, as I am building stuff for others to use. Thank you so very much, it is greatly appreciated!!!! Initially I tried it on a test file, and of course it worked... then I just now tried it on a copy of my live file.... perfect! Again, thanks so much!

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy value & fill color and fill dynamically to last row of data

    Quote Originally Posted by Webbers View Post
    JLGWhiz,

    Brilliant! I knew it was simple... I just simply could not get from point A to B. This one is going in my personal workbook for later too! I almost never work with a static range (or path/filename for that matter). Having the ability to do this and basically everything based on dynamic rows of data is essential, as I am building stuff for others to use. Thank you so very much, it is greatly appreciated!!!! Initially I tried it on a test file, and of course it worked... then I just now tried it on a copy of my live file.... perfect! Again, thanks so much!
    You're welcome,
    regards, JLG

+ 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. Dynamically Create Sheets and Copy Data
    By racer25 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-23-2018, 09:55 AM
  2. VBA Copy Row on Match Data in Two Columns Dynamically
    By AaronSillars in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2015, 10:27 PM
  3. Dynamically apply filter and copy data and paste in another file
    By iamronakjain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2014, 09:25 AM
  4. Macro to dynamically select and copy data from different sheets and columns
    By Gr8tDaze in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 07:32 PM
  5. [SOLVED] Open file dynamically and copy data using advanced filter
    By 4gurus in forum Excel General
    Replies: 4
    Last Post: 09-11-2013, 07:06 AM
  6. How to dynamically fill inn data i first available row in list
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-25-2013, 02:42 PM
  7. fill in table dynamically
    By xlepws in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2012, 03:37 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