+ Reply to Thread
Results 1 to 4 of 4

Clear cell value if another cell is blank

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Clear cell value if another cell is blank

    Hi there, using VBA i'd like to clear the value in cell A2 - when There is nothing (cell is blank) in D4.

    Please advise the code needed on the worksheet to trigger this

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Clear cell value if another cell is blank

    try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    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: Clear cell value if another cell is blank

    Hi,

    You don't say what event should trigger this code?

    i.e. a button click, the sheet Activate event, the sheet Selection Change (presumably D4) event, The Sheet Change Event.. or several others.

    Whatever the event the code will include

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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.

  4. #4
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Clear cell value if another cell is blank

    Thanks Olly, that works

+ 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] VBA Help needed to clear cell contents if the Column “B” cell is blank
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2014, 04:54 AM
  2. [SOLVED] move down column and for every blank cell, clear contents of cell to the left
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2014, 11:23 AM
  3. Clear cell value if cell is blank
    By ashfaquebwd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2013, 01:20 PM
  4. Prefill MonthDate,Clear cell & Default to last blank cell
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2011, 10:08 PM
  5. Clear contents of a cell of row A, if cell in row I is blank
    By salventuro in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2009, 01:58 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