Open excel, ALT + F11 bring up VB window
**************************************** ****************
When the second column of cells is selected, the corresponding cell column is cleared.
**************************************** ****************
Private sub worksheet_change (byval target as range)
If target. Column = 2 then
Cells (target. Row, "C") = ""
Cells (target. Row, "K") = ""
Cells (target. Row, "N") = ""
Cells (target. Row, "R") = ""
Elseif target. Column = 3 then
Cells (target. Row, "K") = ""
Cells (target. Row, "N") = ""
Cells (target. Row, "R") = ""
End if
End sub
**************************************** ****************
Limit cell (K1-N105) drop-down drag-and-drop Replication
**************************************** ****************
Private sub worksheet_selectionchange (byval target as range)
Dim octrl as office. commandbarcontrol
If not intersect (target, range ("$ K $1: $ N $105") is nothing then
Application. celldraganddrop = false
Else
Application. celldraganddrop = true
End if
End sub
Alt + F11 open the VB window, CTRL + G enter application. celldraganddrop = true in the immediate window to remove the restriction cell drop-down and drag-and-drop copy.
Note: The VB Code only achieves the effect when macros are enabled. Therefore, enable macros when the preceding code is used.
Excel VB limit cell drop-down drag-and-drop copy cascade clear cell data