Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
RonB
 
Posts: n/a
Default How do I clear the contents of one cell from another cell?

I would like to clear the contents of a cell in an Excel worksheet from
another cell in the same worksheet based on the content of that other cell.
Stating it in words: if cell A2 equals 1 then set cell A1 equal to "blank".
Is there a simple way to do this? I am using cell A1 for input by the user
therefore A1 cannot contain an equation.
  #2   Report Post  
David Hepner
 
Posts: n/a
Default

You could use this VBA code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A2").Value = 1 Then Range("A1").Value = ""
End Sub


"RonB" wrote:

I would like to clear the contents of a cell in an Excel worksheet from
another cell in the same worksheet based on the content of that other cell.
Stating it in words: if cell A2 equals 1 then set cell A1 equal to "blank".
Is there a simple way to do this? I am using cell A1 for input by the user
therefore A1 cannot contain an equation.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
separating numbers and letters from alphanumeric cell contents PH Excel Worksheet Functions 10 September 3rd 05 01:15 PM
Cell contents as the 'lookup value' parameter in HLOOKUP function EMarre Excel Discussion (Misc queries) 3 August 30th 05 04:49 PM
Conversion of Cell Contents into a Functional Worksheet name ? GMJT Excel Worksheet Functions 1 August 21st 05 05:59 PM
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 04:53 PM
Adding contents of one cell to a range of cells. CLJinVA Excel Worksheet Functions 1 February 10th 05 11:19 PM


All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"