+ Reply to Thread
Results 1 to 4 of 4

1004 Error with Set Range

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2007
    Posts
    40

    1004 Error with Set Range

    Hi,

    I've written a macro, but the following is giving me an error. I'm only just starting out with VBA, so some help/explanation would be great! Have just included an excerpt from the beginning of the code.

    Please Login or Register  to view this content.
    It's the last two Set lines that are giving me the error... Any ideas?
    Cheers
    Steve
    Last edited by Steve_Courts; 11-16-2010 at 09:33 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 1004 Error with Set Range

    The problem may lie in the data itself. Can you post the SUMMARY sheet you're trying to run this on?

    Also, what's the goal of this macro? You may be setting more "ranges" than you need to. It looks like you're getting ready to copy the range of data in A3:A??? to B3:B??? Can you explain what your goal is?

    Click GO ADVANCED and use the paperclip icon to post up a desensitized copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: 1004 Error with Set Range

    Have you got a sheet named Summary?

    Is there data in at least A3 of that sheet?

    This ia better way to write the code, note by using the With Statement & qualifying the references the code will be using Sheet summary,
    Please Login or Register  to view this content.
    Try this code
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-06-2009
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: 1004 Error with Set Range

    Hi All,

    There was data in at least A3 of the sheet as suggested by Roy.

    This was part of a larger macro, I set something early on that clears the summary page to prepare for re-loading the data, and it seemed to work fine!

    Thanks for the help.
    Steve

+ 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