+ Reply to Thread
Results 1 to 3 of 3

Copy paste code error

  1. #1
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Copy paste code error

    Dear all,
    I am new to excel. I am stuck with this code, do not know why it is not working.any clue will be very helpful, thanks

    Please Login or Register  to view this content.
    Last edited by shaukat; 11-22-2011 at 05:37 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy paste code error

    shaukat,

    First off, I'd recommend never using a keyword, like copy, as the name of a macro or function. Use something like CopyPaste or ImportData.

    Second, the way you're declaring the range to copy is using the Cells without a sheet declaration, so they're defaulting to the active sheet. I know you have the sheet declaration outside the range, but within the range you don't have it so that is messing it up. Since you're already getting i and j, just use those directly instead:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Copy paste code error

    wonderful thanks, but wondering why that logic did not work.

+ 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