+ Reply to Thread
Results 1 to 4 of 4

How to change cell value by clicking on the cell

  1. #1
    Registered User
    Join Date
    01-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 20010
    Posts
    28

    How to change cell value by clicking on the cell

    I am using this code within the worksheet but cannot get any functionality in a macro enabled workbook .
    "Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    'Updateby Extendoffice
    Application.EnableEvents = False
    With Target
    If .Address = Range("A1").Address Then
    Select Case .Value
    Case ""
    .Value = "YES"
    Case "YES"
    .Value = "NO"
    Case "NO"
    .Value = "N/A"
    Case Else
    .Value = ""
    End Select
    End If
    End With
    Range("A2").Select
    Application.EnableEvents = True
    End Sub"
    I then hope to adapt this code to function on several cells in this worksheet

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,502

    Re: How to change cell value by clicking on the cell

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-05-2014
    Location
    London, England
    MS-Off Ver
    Excel 20010
    Posts
    28

    Re: How to change cell value by clicking on the cell

    Sorry about the code between
    Please Login or Register  to view this content.
    tags I forgot and used "". I have figured out the solution and wish to tag this as solved
    Last edited by bob07904; 04-04-2021 at 06:58 AM. Reason: SOLVED

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,502

    Re: How to change cell value by clicking on the cell

    You still need to add the code tags.

    For the benefit of others, please share you solution.

+ 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] Change formula reference by clicking on a cell.
    By purlo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2020, 07:01 AM
  2. Replies: 1
    Last Post: 02-03-2015, 06:44 AM
  3. Macros to change a cell value by clicking and to take you to another sheet
    By jhelliar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2011, 10:05 AM
  4. Change Yes/No value by clicking on cell
    By fusion007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-23-2011, 04:11 AM
  5. Replies: 4
    Last Post: 03-25-2011, 07:44 PM
  6. Change color of a cell by just clicking on it?
    By Falantar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2009, 09:18 AM
  7. [SOLVED] how to change cell colour by simply clicking on it
    By lovebunny in forum Excel General
    Replies: 9
    Last Post: 08-10-2006, 02:50 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