Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Feb 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need code (2000)

    <IMG SRC=http://www.boomspeed.com/safiena/excel.JPG>
    I need to create a code to produce the File2 from File1 AND this code can work from any file in similar format to File1.
    There

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: need code (2000)

    Welcome to Woody's Lounge.

    The attached text file contains a macro to do what you want. Substitute the correct names for the source and destination workbooks in the lines

    Set wbkSource = Workbooks("Book1.xls")
    Set wbkTarget = Workbooks("Book2.xls")

  3. #3
    New Lounger
    Join Date
    Feb 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need code (2000)

    I get an error msg that says : Subscript out of range. What does it mean?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: need code (2000)

    Have you replaced "Book1.xls" and "Book2.xls" with the names of your source and target workbooks?
    Also, I assumed that the source worksheet is the first worksheet in the source workbook, and similar for the target worksheet.

  5. #5
    New Lounger
    Join Date
    Feb 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need code (2000)

    I change the Book1.xls to ("Company1.xls") but it did not work. Do I need to put ("C:MyDocument...company1.xls") ? Sorry I do not know how.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: need code (2000)

    1. Both workbooks need to be open in Excel.
    2. You must use the names of the workbooks as displayed in the title bar (and in the Window menu).

  7. #7
    New Lounger
    Join Date
    Feb 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need code (2000)

    Finally, it work! Thanks so much Hans for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •