ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Next time sheet is touched, remove items from cells? (https://www.excelbanter.com/excel-discussion-misc-queries/199015-next-time-sheet-touched-remove-items-cells.html)

Don

Next time sheet is touched, remove items from cells?
 
I had this before and did not get any takers. I think the chalenge is more
getting to do it once and not to check each time?

=============

Not sure how to do this, but I have a sheet that I have a macro export data
and update a field to say processed in cell F5. I want to know if there is a
way to remove that if someone does anything to the sheet like update a
description or update numbers.

This is more a control thing so I know that the file will match the export
and if someone updates something on the sheet, then the word "processed" in
cell F5 will be gone.

thanks in advance


Jim Thomlinson

Next time sheet is touched, remove items from cells?
 
Here is some code that you can put in the sheet. Right click the sheet tab
and select view code. Paste the following:

Private Sub Worksheet_Change(ByVal Target As Range)
Range("F5").Value = ""
End Sub

Whenever anything is changed on the sheet it makes Cell F5 = "". Note that
you may need to do some work on your existing macros as they will be making
changes to the sheet and causing this code to fire. In that case you will
need to turn events off while that procedure runs and back on when it is
finished...

Application.enableevents = false
'your import code
Application.enableevents = true
--
HTH...

Jim Thomlinson


"Don" wrote:

I had this before and did not get any takers. I think the chalenge is more
getting to do it once and not to check each time?

=============

Not sure how to do this, but I have a sheet that I have a macro export data
and update a field to say processed in cell F5. I want to know if there is a
way to remove that if someone does anything to the sheet like update a
description or update numbers.

This is more a control thing so I know that the file will match the export
and if someone updates something on the sheet, then the word "processed" in
cell F5 will be gone.

thanks in advance


Gord Dibben

Next time sheet is touched, remove items from cells?
 
Sheet event code to clear F5 if any cell other than F5 is changed.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$F$5" Then
On Error GoTo endit
Application.EnableEvents = False
Me.Range("F5").Value = ""
End If
endit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Fri, 15 Aug 2008 09:59:02 -0700, Don
wrote:

I had this before and did not get any takers. I think the chalenge is more
getting to do it once and not to check each time?

=============

Not sure how to do this, but I have a sheet that I have a macro export data
and update a field to say processed in cell F5. I want to know if there is a
way to remove that if someone does anything to the sheet like update a
description or update numbers.

This is more a control thing so I know that the file will match the export
and if someone updates something on the sheet, then the word "processed" in
cell F5 will be gone.

thanks in advance




All times are GMT +1. The time now is 12:23 PM.

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