none
VBA trouble RRS feed

  • Question

  • Hi I'm new to this and i am trying to copy a range of lines from one workbook and paste it in another workbook.

    im also trying to filter the range i select by specific proples names and just paste that by im having trouble doing that and looping it so that it just stops after a certain name 

    does anyone have any ideas?

    Windows("2. JUNE 03.XLS").Activate
    Sheets("DIST ERRORS").Select
        ActiveCell.Offset(1, 0).Range("A1:D1").Select
        Selection.Copy
        Windows("Workbook3").Activate
         ActiveSheet.Paste

    End sub

    Sunday, July 6, 2014 4:33 PM

All replies

  • Rather than post a bit of code that has apparently been created by the macro recorder, and which is not going to do what you require, can you provide a breakdown of the task?

    Presumably you will want the macro to operate on the currently open workbook? The second workbook doesn't appear to be named, so can we assume that is a new workbook and that the data will go in the first sheet?

    What EXACTLY do you want to copy to that other worksheet? What determines which columns and which rows you wish to copy?

    You indicate that you want to loop through a range and look for an (unnamed) name and stop processing. Where is that name in relation to the range? Will it always be the same name? Or do you mean that you only want to transfer data relating to a particular name?


    Graham Mayor - Word MVP
    www.gmayor.com


    Monday, July 7, 2014 5:49 AM