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

1 Answer

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

Hello

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
End Sub
by Expert (754 points)
I have asked for snapshot. Generally have a look at the post again.

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

Looking for something else? Hire our professional VBA Help, instead.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and answers. All you have to do is post and you could get rewarded, like these members:

Hightree $10 Amazon Gift Card
Thales1 $10 Amazon Gift Card
runfunke $10 Amazon Gift Card
coolag $10 Amazon Gift Card
Siew Hun $10 Amazon Gift Card

So, why don't you join us? It really is an encouraging way to motivate members in our VBA and Python community.

Register

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

...