user155754
user155754

Reputation: 93

Excel VBA - clear blank not empty cells

I have cells that are blank but not empty. Is there a way to clear that content from them?

Upvotes: 1

Views: 876

Answers (1)

user155754
user155754

Reputation: 93

For Each c In Selection
    If IsNumeric(c) Then
        c.Value = 1 * c.Value
    Else
        c.Value = Delete
    End If
Next c

I used this code. This converted numbers stored as texts to numbers. And blank not empty cells to empty cells. And it worked. It's a bit slow for big ranges, but it works fine.

Upvotes: 1

Related Questions