Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Exclude a range from "0"
Does anyone how to exlude a range from the code as outlined below. I need to
have "P10:P24" show up as blank when a user hits the delete button. Thanks! Private Sub Worksheet_Change(ByVal Target As Range) Dim myCell As Range Dim myRng As Range Set myRng = Me.Range("E10:AK24") Application.EnableEvents = False For Each myCell In Intersect(Target, myRng).Cells If myCell.Value = "" Then myCell.Value = 0 End If If Not Intersect(myCell, Me.Range("E10:M24")) Is Nothing Then myCell.Value = Abs(myCell.Value) End If If Not Intersect(myCell, Me.Range("Q10:AH24")) Is Nothing Then myCell.Value = -Abs(myCell.Value) End If Next myCell Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Sum a range but exclude and negative values | Excel Worksheet Functions | |||
Duplicate Range Names by worksheet | Excel Discussion (Misc queries) | |||
Need to exclude certain cells in a range | Excel Worksheet Functions | |||
Array to named range conversion... | Excel Discussion (Misc queries) |