+ Reply to Thread
Results 1 to 6 of 6

Problem with Run Time Error 1004

  1. #1
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78

    Problem with Run Time Error 1004

    Hope someone can help me with a macro that's just stopping, displaying the 1004 error message, plus the text:
    "This formula is missing a range reference or a defined name".
    The macro's 1st line is to go to a named range. Then it stops, just before a line which has the command to clear the contents. There's no protection in place, with cells locked. The range name happens to be "ComboListBB" - is that name problematic in some way? A similar macro I have goes to a range called "ComboListB", no problems there. The range contains various values, and can be selected 'manually' no problem. Thanks for any hints.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Problem with Run Time Error 1004

    What's the actual line of code that's highlighted in yellow when the Debug message box pops up?
    Better still upload the workbook so that we can see the problem in context.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78
    Quote Originally Posted by Richard Buttrey View Post
    What's the actual line of code that's highlighted in yellow when the Debug message box pops up?
    Better still upload the workbook so that we can see the problem in context.
    It was the usual Goto.Reference: "..." (Using my phone, have not got the bva to hand...). Hope that is sufficient info, thanks.

  4. #4
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78
    Quote Originally Posted by lotusman View Post
    It was the usual Goto.Reference: "..." (Using my phone, have not got the bva to hand...). Hope that is sufficient info, thanks.
    Actually, I've solved it. I made a copy of a spreadsheet page. That page had 6 named ranges. Now the copy of that page had 6 more ranges with the same names, located in 'parallel' areas. I changed the six new names, adding B to each one, e.g. CellChoice became CellChoiceB. I had a macro doing something with CellChoice. I copied it and edited it so that it handled the new ranges, on the new page. However, it seemed to think a new range had not been properly defined, and it would not function. Instead, I deleted the new range names, and recreated them 'manually'. Macros now work with these 'proper' ranges. That was it.
    Lotusman

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Problem with Run Time Error 1004

    Don't forget its's perfectly possible to have the same range name on different sheets.
    The default scope for a named range is the workbook but if you want to limit the scope to a particular worksheet then yuo need to incorporate the sheet name in the range name definition.

  6. #6
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78
    Quote Originally Posted by Richard Buttrey View Post
    Don't forget its's perfectly possible to have the same range name on different sheets.
    The default scope for a named range is the workbook but if you want to limit the scope to a particular worksheet then yuo need to incorporate the sheet name in the range name definition.
    Thanks, Richard, I'll check that out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Problem in paste - Run time error 1004
    By Sekars in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2016, 10:01 AM
  2. VBA Vlookup Problem - run time error '1004'
    By rsami in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2013, 11:13 AM
  3. Run-time error 1004 - save as pdf problem
    By vvujke in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-05-2013, 10:03 PM
  4. Run time error 1004 syntax problem
    By 1eyedjack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 04:51 AM
  5. Problem Run-time error '1004'
    By PeterSi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2007, 08:46 AM
  6. Replies: 2
    Last Post: 07-10-2006, 04:27 PM
  7. VBA VLookup Problem: Run-Time error '1004'
    By hurlbut777 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2005, 09:06 PM

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