May 15 2020 08:22 PM
For each row, I need to clear the cell in column B if column A contains any text. The number of rows may vary. The attached example has Before and After sheets.
May 16 2020 01:17 AM
Solution@LonnieCurrier Try this very small macro.
Sub ClearIfText()
Dim DataRange As Object
Dim i As Integer
Set DataRange = Range("A1").CurrentRegion
For i = 1 To DataRange.Rows.Count
If DataRange.Cells(i, 1) <> "" Then
DataRange.Cells(i, 2).ClearContents
End If
Next
End Sub
May 16 2020 01:17 AM
Solution@LonnieCurrier Try this very small macro.
Sub ClearIfText()
Dim DataRange As Object
Dim i As Integer
Set DataRange = Range("A1").CurrentRegion
For i = 1 To DataRange.Rows.Count
If DataRange.Cells(i, 1) <> "" Then
DataRange.Cells(i, 2).ClearContents
End If
Next
End Sub