+ Reply to Thread
Results 1 to 3 of 3

Naming a range and then pasting a value into that range

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    40

    Naming a range and then pasting a value into that range

    Hello,

    This seems like a procedure that should be mindlessly simple, but when I attempt to do it, I get an error.


    Please Login or Register  to view this content.
    The error I get is:

    Run time error 1004
    Method 'range' of object '_global' failed

    If anyone could tell me what is wrong with this small bit of code it would be greatly appreciated.

    I am actually trying to debug a more difficult program and this seems to be the problem that is holding me up.

    Here is the real program:
    Please Login or Register  to view this content.
    If I use
    Please Login or Register  to view this content.
    instead of asking the user to define the location it works fine. It seems that assigning a destination a name and then referencing that name is what is giving me the problem.

    The error I get is slightly different (Pastespecial method of range class failed), but the section I metioned above is the only thing that I can narrow it down to

    Thanks in advance for any help!

    Shannon

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Naming a range and then pasting a value into that range

    Try this. 'dest' is already designated as an object (in this case, range) variable. The Range("dest") would only be needed for a named range. Also, you can explicity declare it as a Range variable rather than a Variant, which is marginally better practice.
    Please Login or Register  to view this content.
    As to your actual problem, I think the only issue was that you were clearing the clipboard by the second inputbox, so try this
    Please Login or Register  to view this content.
    Last edited by StephenR; 09-12-2012 at 11:35 AM.

  3. #3
    Registered User
    Join Date
    08-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    40

    Re: Naming a range and then pasting a value into that range

    That worked incredibly well. Did not even consider that I could have been clearing the clipboard.

    THANK YOU!!!

    Shannon

+ 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