+ Reply to Thread
Results 1 to 4 of 4

Run macro and copy results from one column into open worbook

  1. #1
    Registered User
    Join Date
    02-01-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    33

    Run macro and copy results from one column into open worbook

    I have two workbooks,

    One contains a macro that I run to update a results column in the first workbook

    I want to run the macro located in the first workbook, copy C8:C48 on Sheet3 and then paste the results into the second workbook called results.xlsx sheet 1 B4:B42

    I then want to run the macro again and copy the results from C8:C48 and then paste the results into the second workbook into the next column C4:C42

    The macro then needs to run a further 28 times, populating the second workbook with 30 columns

    The macro is called SRSrun

    Thanks for your help

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,955

    Re: Run macro and copy results from one column into open worbook

    Sorry, I'm a little confused. Are you saying you want 28 copies of the information in cell C8:C48? Note that your source and target do not have the same number of cells.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    02-01-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Run macro and copy results from one column into open worbook

    Made a typo in my original post, here is the correction

    I have two workbooks,

    One contains a macro that I run to update a results column in the first workbook

    I want to run the macro located in the first workbook, copy C8:C48 on Sheet3 and then paste the results into the second workbook called results.xlsx sheet 1 B4:B44

    I then want to run the macro again and copy the results from C8:C48 and then paste the results into the second workbook into the next column C4:C44

    I want the macro to run a total of 30 times, I want the second workbook to contain 30 columns of information taken from the first workbook

    The macro is called SRSrun

    Thanks for your help

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,955

    Re: Run macro and copy results from one column into open worbook

    I'm not sure why you're telling us the macro name. There's not a lot anyone can do with a macro name.

    If I understand correctly, workbook1 has a macro that updates infomation in workbook1; workbook2 has another macro that runs the macro in workbook1 and copies the resulting data from workbook1 to somewhere in workbook2 ... effectively, a test harness.

    So far so good?

    Ok, if you want anyone to help you with that, I would suggest that you provide sample copies of the workbooks and any VBA code that they are dependent upon.

    I don't think anyone is going to be willing to set up a test environment in order to develop and test code ... for you to say, "that's great, but it doesn't look/work like that".


    Regards, TMS

+ 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