+ Reply to Thread
Results 1 to 10 of 10

Macro Copy/Paste to chart

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Macro Copy/Paste to chart

    I use the record macro feature a lot since I don't really know any VBA. I need to be able to copy a Vlookup formula and paste it to all rows below until the adjacent columns are blank. Normally you can just double-click the bottom right corner and it will automatically apply the formula to the spaces below until the bottom of the chart. But when recording a macro this double-click trick does not transfer to the correct command. Instead it refers to the specific cells, which means the macro won't adjust to the size of the chart.

    Any solutions?

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro Copy/Paste to chart

    Bump. No reply.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Macro Copy/Paste to chart

    Probably because nobody can understand your question.

    You may have more luck if you post a workbook example with information that shows start and finish data sets and explain why copying down alone does not suffice.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro Copy/Paste to chart

    I have attached an example. The Macro pastes the Vlookup formula to the rows below but it does not know when to stop pasting.
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Macro Copy/Paste to chart

    The workbook contains no code and the data on the worksheet contains no formula.

    Not sure how that helps.

  6. #6
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro Copy/Paste to chart

    Andy,

    I had to delete out some of the information because it's proprietary to the company I work for. Shoot, I thought it was an easy question that could be answered with one quick command. I don't see why an example is necessary with this one.

    When you double click on the bottom right corner of anything it automatically pastes to all cells in the row below until the bottom of the chart. There has to be a simple command for this, but the macro recorder doesn't pick it up.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Macro Copy/Paste to chart

    Please Login or Register  to view this content.
    I cleared the contents of C6 downwards. I then double clicked C5 to fill the range C5:C18 with "Akinaw Bulcha".


    It probably is something simply but without know exactly what you are using and with the layout of the data you have we can only guess.
    The main reason for the cells beyond the table of data populating is that the cells around actually contain formula even if the results of the formula are not displayed.

  8. #8
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro Copy/Paste to chart

    Yes I need something that will autofill to whatever range necessary depending on the size of the chart. It should be more like
    Selection.Autofill Destination:=Range("C5:C?") Perhaps it's not as simple of a command as I imagine.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Macro Copy/Paste to chart

    Using the column to the left of the activecell to determine end of data.

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro Copy/Paste to chart

    Andy, Thanks that looks like what I need. When I get back to work on Monday I'm excited to try this. I have many macros that could benefit from this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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