+ Reply to Thread
Results 1 to 8 of 8

copy files from one worksheet to another

  1. #1
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    copy files from one worksheet to another

    hi,
    got this code and i want to copy the cells from recording.xlsb to openWB, openWC and OpenWD but somehow it does not work. what is the problem?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: copy files from one worksheet to another

    You need to be more specific - your workbooks are actually ranges in "Thisworkbook" which must be already open
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: copy files from one worksheet to another

    Hi, freak11,

    you should adapt the code as I think it to be no good programming to use ActiveSheet and hoping for the user to have the workbook closed with the relevant sheet on top. And you really want to go from Row 5 up towards the first empty row?

    Untested:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    Re: copy files from one worksheet to another

    Hi holger,
    thanks for the correction but your code copies all the values from N5 to the set openWb. why is nothing being copied to openwc and open wd?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: copy files from one worksheet to another

    Hi, freak11,

    I had corrected the fault in the Forum when I decided to make more changes in my testbook (but didnīt think of that change nor copied it over again into the workbook) - sorry for that.

    The ranges need to be preceeded by a dot like
    Please Login or Register  to view this content.
    in order to reference each workbook whereas the code I posted would rely on the ActiveSheet no matter which workbook I wanted to copy to.

    Ciao,
    Holger

  6. #6
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    Re: copy files from one worksheet to another

    thanks. it works now but how would i incorporate the command below into the code?

    Please Login or Register  to view this content.

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: copy files from one worksheet to another

    Hi, freak11,

    I really donīt get what you are asking as I canīt find any relation to the opening post but maybe instead of
    Please Login or Register  to view this content.
    itīs
    Please Login or Register  to view this content.
    Ciao,
    Holger

  8. #8
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    Re: copy files from one worksheet to another

    I am sorry. I did not clarify myself. I wanted to insert this code:
    Please Login or Register  to view this content.
    In order to draw a stock chart in the sheet openWB WC OR WD, but instead it does it in the sheet called recording.xlsb (the original sheet from which i run the macro).

    For drawing the stock chart i wanted to insert this code as next step after selecting the range:

    Please Login or Register  to view this content.
    I cannot run this code before selecting the range and the range corresponds to the value in cell N5. that is my whole purpose.

+ 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. [SOLVED] Need to copy values from all files in folder from specific worksheet
    By jh51745 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-03-2013, 01:05 PM
  2. need macro to copy same rows in 120 files into new worksheet
    By Nila in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2013, 02:31 PM
  3. Copy worksheet to WorkBook, from multiple files
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2009, 11:11 AM
  4. [SOLVED] Copy worksheet template to all files
    By KeenKiwi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2006, 03:20 PM
  5. Replies: 0
    Last Post: 08-31-2005, 07:05 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