PDA

View Full Version : Solved: if column B is empy delete the data on column A



parscon
09-16-2012, 01:51 PM
Hello to all .

I have a request , I need a VBA code that if column B is empty , delete the data on column A on that row , just I do not want to delete the row .

Please help me on this subject .

Thank you very much .

GarysStudent
09-16-2012, 04:55 PM
Perhaps:



Sub ClearA()
Dim r As Range
For Each r In Intersect(Range("B:B"), ActiveSheet.UsedRange)
If IsEmpty(r) Then
r.Offset(0, -1).Clear
End If
Next
End Sub

parscon
09-16-2012, 06:47 PM
Thank you very much .