How create blank cell value as the result of Excel "IF" function?

  • Thread starter Pocket Protector as a Fashion Statement
  • Start date
P

Pocket Protector as a Fashion Statement

How can I best create blank cell value as the result of the Excel "IF"
sorksheet function?

That would be useful "Paste Special" a column or row of the results over an
existing column of entries, while skipping blanks, to over-write only the
cells for which the results are non-blank.
 
G

Gary''s Student

Let's say we have data from A1 thru A100, but there are some blanks in it.

We want to copy column A to column B, but not the blanks in column A.

So if A10 is blank, don't copy it over.


Sub copy_no_blanks()
For i = 1 To 100
If Cells(i, "A") = "" Then
Else
Cells(i, "A").Copy Cells(i, "B")
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top