ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   clear cell based on text in opposing column (https://www.excelbanter.com/excel-worksheet-functions/194716-clear-cell-based-text-opposing-column.html)

[email protected]

clear cell based on text in opposing column
 
I am attempting to clear a cell in column V based on the text of the
same row in column G.
With actual numbers, I can do SUMIF(G9:G123,"5",V9:V123) - but I want
to actually clear the respective cell in V if "payments" is in column
G, and leave it alone if blank or other text exists. How can I do
that?

DLR

Don Guillett

clear cell based on text in opposing column
 
Right click sheet tabview codeinsert this. Now if you type in the word
payments into col g col v will CLEAR
Is that what you want?

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("g")) Is Nothing Then Exit Sub
If UCase(Target) = "PAYMENTS" Then Cells(Target.row, "v").ClearContents
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
I am attempting to clear a cell in column V based on the text of the
same row in column G.
With actual numbers, I can do SUMIF(G9:G123,"5",V9:V123) - but I want
to actually clear the respective cell in V if "payments" is in column
G, and leave it alone if blank or other text exists. How can I do
that?

DLR



[email protected]

clear cell based on text in opposing column
 
I apologize for posting in two groups.

Not really what I need - column V is a penalty fee automatically added
at month end, but if "payments" have been arranged in column G, the
penalty is deferred... or simply cleared from that cell. I need a
macro, or code of some kind, that will parse at a determined point in
time - and if payments have been arranged, the fee in column V for
that person will be cleared. There may be other annotations in column
G, or none, that will be ignored.
I need a conditional formula - just can't get it figured out.
if (G9:G90,"payments" .... then V9:v90 clears ..... I'm lost. I have
hundreds of lines of code in these sheets, so I have some
understanding of what I'm doing, just not here.


DLR


On Sun, 13 Jul 2008 17:51:28 -0500, "Don Guillett"
wrote:

Right click sheet tabview codeinsert this. Now if you type in the word
payments into col g col v will CLEAR
Is that what you want?

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("g")) Is Nothing Then Exit Sub
If UCase(Target) = "PAYMENTS" Then Cells(Target.row, "v").ClearContents
End Sub



All times are GMT +1. The time now is 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com