Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete row base the value of certain column
Hi How are you?
My customer report this to me, he delete some row by mistake using hot key Ctrl-D. he want me to put code to prevent it happening. What I shold do it, check a certain column (e.g. column ZZ), if there are value, DO NOT delete this row. cancel the deletion. if it is empty, it is fine to delete. after some research, here is my plan, 1. assign Ctrl-D to my DoNothing routine, 2. in Worksheet_SelectionChange function, I will check if a value in column ZZ, yes, I am not change hot key assignment by Application.OnKey "^{d}", "" no, I will assign Ctrl-D back to Delete row by Application.OnKey "^{d}", "InsertProc" Now my problem is, I do not how to do that. which command string should I use in the place of "InsertProc". Your help will be deeply appreciated. aboud my solution, if you have any idea, suggestion, advice, anything, I would love to hear. Thank you and have nice day. Wes code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target(1, 1).Value < "" Then Application.OnKey "^{d}", "" MsgBox "disable" Else Application.OnKey "^{d}", "InsertProc" ' <- here is my question MsgBox "enable" End If End Sub Public Sub Donothing() MsgBox "Here is my DoNothing" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy column header to next column, delete & delete every nth colum | New Users to Excel | |||
Merging rows base on value in other column | Excel Discussion (Misc queries) | |||
Sort Data Base By Column | New Users to Excel | |||
select a range base on Column A | Excel Programming | |||
Row to column data move base on row | Excel Programming |