[Solved] Copying the cell and delete column under the certain condidions [closed]


Your description is vague, but to get what you described exactly:

 Public Sub Process()
     If Range("A2").Value <> "" Then
         Range("B2").Copy Range("C3")
         Range("B2").EntireColumn.Delete
     End If
 End Sub

Edit

In worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = Range("A2").Address And Range("A2").Value <> "" Then             
         Range("C3").Value = Range("B2").Value
         Range("B2").EntireColumn.Delete
     End If
End Sub

I think it’s the closest you can get. It won’t fire on every click, but on selection change to A2.

6

solved Copying the cell and delete column under the certain condidions [closed]