+ Reply to Thread
Results 1 to 7 of 7

Selecting a Single Cell in Commandbutton

  1. #1
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Selecting a Single Cell in Commandbutton

    Hello,

    Can somebody find the problem for me. In the commandbutton feature I'm getting an error at the end when I want to end up Selecting a single cell.

    Please Login or Register  to view this content.
    Thanks for the help.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Selecting a Single Cell in Commandbutton

    I ran your code and it was executed without any problem. It selected A2 in the end.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Selecting a Single Cell in Commandbutton

    hi trevor2524,

    What is error you are getting? see the attached its working for me.

    Regards,
    Joshi
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  4. #4
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Selecting a Single Cell in Commandbutton

    When I run it from a commandbutton I get the follow error: Select Method of Range class failed. Is there another way I should do this so I can make the entire sheet yellow and end by selecting A2?

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Selecting a Single Cell in Commandbutton

    It will throw that error if your command button is not on Sheet1 as per your code. If this is the case, try something like this.......
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Selecting a Single Cell in Commandbutton

    Thank You!

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Selecting a Single Cell in Commandbutton

    Did it work?

+ 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. Commandbutton in userform to execute code based on a previous commandbutton choice?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2012, 03:28 PM
  2. Replies: 6
    Last Post: 07-10-2012, 11:30 AM
  3. Selecting a Range not just a single cell
    By Sanecrazy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-07-2012, 09:31 AM
  4. Selecting all cells in a worksheet using commandbutton
    By ingolf_ingolfsen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2011, 05:09 AM
  5. Replies: 1
    Last Post: 01-14-2010, 11:24 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