0 votes
in VBA by Beginner (5 points)
If IsEmpty(Range("A2")) = True Then Range("B2") = ""

1 Answer

+1 vote
by Expert (916 points)
selected by
Best answer


Can you post snapshot of your data and how would you like the desired results?

You can use this

Sub Test()
    Dim i As Long
    For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
        If IsEmpty(Range("A" & i)) = True Then Range("B" & i) = ""
    Next i
End Sub


by Beginner (5 points)
Private Sub CommandButton2_Click()

If IsEmpty(Range("A2")) = True Then Range("B2") = ""

End Sub
by Expert (916 points)
I have asked for snapshot. Generally have a look at the post again.

Welcome to wellsr Q&A
Ask any questions you have about VBA and Python and our community will help answer them. wellsr Q&A is the standalone question and answer platform for wellsr.com. If you have a question about one of our specific tutorials, please include a link back to the tutorial.

Getting Started
VBA Cheat Sheets (On Sale Now)

Looking for something else? Hire our team directly through ourVBA Help page, instead.

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.