ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   deleting cells that are controlled using Target code (https://www.excelbanter.com/excel-discussion-misc-queries/237852-deleting-cells-controlled-using-target-code.html)

NDBC

deleting cells that are controlled using Target code
 
I have columns that are set up to automatically respond when they contain the
target cell. The code below all works fine. My problem is that when I
finished I need to clear these cells. I am currently doing this by selecting
a range and making it equal to "". This causes an error in the code below. Is
there some way of disabling the target code when I delete the range.

Thanks

If Target.Column = 11 Then
Target.Offset(0, 1) = WorksheetFunction.Max(Range("L:L")) + 1

Don Guillett

deleting cells that are controlled using Target code
 
try this as the first line
If Target.Count 1 Then Exit Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"NDBC" wrote in message
...
I have columns that are set up to automatically respond when they contain
the
target cell. The code below all works fine. My problem is that when I
finished I need to clear these cells. I am currently doing this by
selecting
a range and making it equal to "". This causes an error in the code below.
Is
there some way of disabling the target code when I delete the range.

Thanks

If Target.Column = 11 Then
Target.Offset(0, 1) = WorksheetFunction.Max(Range("L:L")) + 1



NDBC

deleting cells that are controlled using Target code
 
Don. Works a treat. Thanks again.

"Don Guillett" wrote:

try this as the first line
If Target.Count 1 Then Exit Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"NDBC" wrote in message
...
I have columns that are set up to automatically respond when they contain
the
target cell. The code below all works fine. My problem is that when I
finished I need to clear these cells. I am currently doing this by
selecting
a range and making it equal to "". This causes an error in the code below.
Is
there some way of disabling the target code when I delete the range.

Thanks

If Target.Column = 11 Then
Target.Offset(0, 1) = WorksheetFunction.Max(Range("L:L")) + 1





All times are GMT +1. The time now is 04:40 AM.

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