+ Reply to Thread
Results 1 to 18 of 18

Copy data from another worksheet without open that workbook

  1. #1
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Copy data from another worksheet without open that workbook

    Hi
    I have this VBA that work for me, but I want to update my sheet without opening the other file. any idea how i can do this?
    thanks in advance.

    Please Login or Register  to view this content.
    Last edited by robrobet; 07-04-2013 at 02:04 PM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Copy data from another worksheet without open that workbook

    I guess you could try something like:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    Thanks for reply, this code work fine but when it copy the value then show me ref, ref in all cells,

  4. #4
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    Sorry little more, is it possible when it copy to active worksheet then it start from active cell insted of sheet 1 range b5 :g42

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Copy data from another worksheet without open that workbook

    Weird, dunno what is happening there but I think this should fix it:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    For Each cL In wb.Sheets("Sheet1").Range(activecell,cells(activecell.row+37,activecell.column+5).Cells

    this line show red when I run it
    Thanks for helping.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Paste data to active worksheet on active cell

    Quote Originally Posted by robrobet View Post
    I want this VBA to change when it paste the data it paste to activesheet on active cell.
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Paste data to active worksheet on active cell

    I get this error
    wb.ActiveSheet.ActiveCell.Resize(38, 6).Value = wb2.Worksheets("POMaster").Range("B5:G42").Value

    Object does not support this property or method

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Paste data to active worksheet on active cell

    Ok then try this...

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Paste data to active worksheet on active cell

    it work first time but now showing error,
    DestCell.Resize(38, 6).Value = wb2.Worksheets("POMaster").Range("b5:g42").Value
    Last edited by robrobet; 06-26-2013 at 04:26 PM.

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Paste data to active worksheet on active cell

    Quote Originally Posted by robrobet View Post
    it work first time but now showing error,
    DestCell.Resize(38, 6).Value = wb2.Worksheets("POMaster").Range("b5:g42").Value
    Cross-post
    http://www.mrexcel.com/forum/excel-q...ive-sheet.html

    A message to forum cross posters

  12. #12
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Copy data from another worksheet without open that workbook

    One more try:
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    Thanks Yudlugar,
    It work but not the way I want. Please help to change to.... I want copy the data from sheet pomaster range b5 :g42 and paste it to selected cell.

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

    Re: Copy data from another worksheet without open that workbook

    Hi, robrobet,

    instead of
    Please Login or Register  to view this content.
    try
    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

  15. #15
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    I get this error when I change it
    Object does not support this property or method

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

    Re: Copy data from another worksheet without open that workbook

    Hi, robrobet,

    my bad (file needs to be open) - could you explain to me why you would not open the other workbook, copy and then close again? Maybe read Copy a range from closed workbooks (ADO) for more information.

    BTW: please apply to use code-tags on the procedure in the opening post. If you canīt edit that post maybe contact a Mod/Admin to do so. Thanks.

    Ciao,
    Holger

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Copy data from another worksheet without open that workbook

    Robrobet,

    In future, please do not post duplicate threads. Its against forum rules 5.

    As per forum rules 3, you need to put code tags whenever you post code in this forum.

    As per rule 4, do not PM questions to other forum members.

    Dont freak out by so many rule violations. You are new to the forum and will learn. Just pay attention to the forum rules a little more.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  18. #18
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Copy data from another worksheet without open that workbook

    Thanks you
    Last edited by robrobet; 07-04-2013 at 11:57 AM.

+ 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