+ Reply to Thread
Results 1 to 4 of 4

error 1004 range object _global failed when sorting table on color

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    error 1004 range object _global failed when sorting table on color

    Hi,

    I am trying to create a macro that sorts a table on the colors of its cells.
    I am getting an error: "error 1004 range object _global failed"
    I named the table and the column ranges. What am i doing wrong?

    Any input is very much appreciated!


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: error 1004 range object _global failed when sorting table on color

    Use the actual name. For example, Set colNaam = Range("Naam")

  3. #3
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Re: error 1004 range object _global failed when sorting table on color

    Thank you, problem solved. Sometimes the solution can be so simple

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: error 1004 range object _global failed when sorting table on color

    Given that you have a table, why not use the table's column headers?
    Remember what the dormouse said
    Feed your head

+ 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] Error '1004': Method 'Range' of object '_Global' failed
    By ndudley26 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2018, 02:03 AM
  2. Run-time error '1004': Method 'range' of object '_Global' failed
    By rubenidas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2016, 05:14 PM
  3. [SOLVED] Run-time error '1004' : Method 'Range' of object'_Global' failed
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2015, 09:47 AM
  4. Run-time error '1004' Method 'Range' of object'_Global' failed
    By mbie451 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2014, 01:40 PM
  5. Run0time error '1004': Method 'Range' of object '_Global' failed
    By ba_thomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2012, 09:16 AM
  6. Runtime Error 1004 Method 'Range of Object'_Global' failed
    By popfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2011, 12:52 AM
  7. [SOLVED] Error 1004 Method 'Range' of object '_Global' failed
    By bjwade62 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2006, 11:00 AM

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