+ Reply to Thread
Results 1 to 8 of 8

Error with VBA code Copying cells to a closed workbook, template sheet, documents and

  1. #1
    Forum Contributor
    Join Date
    01-21-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    105

    Error with VBA code Copying cells to a closed workbook, template sheet, documents and

    I have written this code and it errors at
    Please Login or Register  to view this content.
    It say and object is required. Can anyone help?

    Please Login or Register  to view this content.
    Thank you all in advance
    Last edited by Libster78; 01-30-2010 at 12:32 PM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    You need to declare it as a range and use Set when you assign it:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    01-21-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    105

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    Hi there
    I'm very new to this so am not sure what I do to do that.
    Sorry for being a bit dim about it.
    Thanks for it help.
    Libby

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    Use the code I just posted?

  5. #5
    Forum Contributor
    Join Date
    01-21-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    105

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    Sorry. Didn't see the difference at first. I'll give that a go. If I want to copy certain cells such as I9, B9, K44 then paste them on to the next available row on the purchase order spreadsheet consecutively i.e. B1 to B3 is there a better way than copying the copy paste section for each and changing the offset? Can I list the range I.e. Range(I9, B9, K44). And then in paste section repeat the offset (1,0) then offset(1,1), etc?
    Thanks again for advice so far and sorry for not paying full attention.
    Libby

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    It would spend which cells you want to copy and to where. Based on those examples I think you would need to do one at a time.

  7. #7
    Forum Contributor
    Join Date
    01-21-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    105

    Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    Ok thank you. I will give it a go now.
    I might be back with more but hopefully just to say all is good.

    Thank you again.
    Libby

  8. #8
    Forum Contributor
    Join Date
    01-21-2010
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    105

    Smile Re: Error with VBA code Copying cells to a closed workbook, template sheet, documents

    Hi R,

    Apologies for the delay I had to add a few bits in to copy and paste all te cells I needed but it works.

    Over the moon.

    Thanks you so much

+ 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