FotoDJ
FotoDJ

Reputation: 351

vba cell find empty and change value in different cell

I need help with this problem:

If any cell in column A is empty then in Columns D and E delete cells in the same row but shift up only cells in Columns D and E, Column A will stay untouched...

Upvotes: 0

Views: 58

Answers (1)

user6432984
user6432984

Reputation:

Sub DeleteUP_D_and_E_IF_A_IsEmpty()

    Dim LastRow As Long, x As Long

    LastRow = Range("A" & Rows.Count).End(xlUp).Row


    For x = 2 To LastRow

        If Cells(x , 1) = "" Then Range(Cells(x, "D"), Cells(x, "E")).Delete Shift:=xlUp

    Next


End Sub

Upvotes: 1

Related Questions