+ Reply to Thread
Results 1 to 4 of 4

Highlight (grey) a randomly selected cell

  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    Nevada
    MS-Off Ver
    Excell 2007
    Posts
    9

    Highlight (grey) a randomly selected cell

    Hi, I recorded a macro to select a cell and highlight in grey. I tried to modify to select a random cell and highlight it but the WITH to highlight the selected cell fails. I can see the random cell being selected but the WITH fails with: Run-time eror '1004': Method 'Range' of object' _Global failed

    Any help will be appreciated, thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,087

    Re: Highlight (grey) a randomly selected cell

    randcell is a variable, not a text string so remove the quotes.

    And it's range so you don't need Range(...)

    Regards, TMS
    Last edited by TMS; 01-20-2014 at 10:17 AM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-10-2014
    Location
    Nevada
    MS-Off Ver
    Excell 2007
    Posts
    9

    Re: Highlight (grey) a randomly selected cell

    Thank you TMS

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,087

    Re: Highlight (grey) a randomly selected cell

    You're welcome. Thanks for the rep.

+ 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. Highlight cell if row is selected?
    By SneakyPiglet in forum Excel General
    Replies: 1
    Last Post: 10-04-2013, 06:55 PM
  2. Grey out check box based on a selected radio button
    By tlacloche in forum Excel General
    Replies: 16
    Last Post: 08-28-2013, 05:36 AM
  3. [SOLVED] Grey out checkboxes until name is selected - Userform
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2013, 03:21 AM
  4. How to highlight the selected cell
    By jeffreykeefer in forum Excel General
    Replies: 2
    Last Post: 03-03-2008, 12:33 PM
  5. OFFSET a RANDomly selected INDEX cell?
    By Clark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2008, 05:30 PM

Tags for this Thread

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