Clear blank cells

  • Thread starter Thread starter Reed
  • Start date Start date
R

Reed

Hi,

I have a worksheet with cells that appear blank, but have an "apostrophe" in
them when you edit the cell. How can I clear all of these cells?

Thanks,

Reed
 
Select the cells in question and use the following macro:

Sub AAA()
Selection.Clear
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Is it possible to make a macro that automatically selects the cells?

Thanks,

Mike



Select the cells in question and use the following macro:

Sub AAA()
Selection.Clear
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Phillip London UK
Sub SelectApostrophe()
Dim rng As Range
Dim cl as range
For Each cl In Range("C1:C10")
If Len(cl.Value) = 0 And Not IsNumeric(cl.Value) Then
If rng Is Nothing Then
Set rng = cl
Else
Set rng = Union(rng, cl)
End If
End If
Next
rng.Select
End Sub
 
Reed, following cleans cells containing ' or (multiple) spaces.

Sub AlmostEmptyCleaner()
Dim r As Range, c As Range, u As Range

On Error Resume Next
Set r = ActiveSheet.UsedRange.SpecialCells(xlConstants)
On Error GoTo 0

If Not r Is Nothing Then
For Each c In r
If Trim(c.Formula) = vbNullString Then
If u Is Nothing Then Set u = c Else Set u = Union(u, c)
End If
Next
End If

If Not u Is Nothing Then
MsgBox "Cleaning " & u.Count & " cells"
u.ClearContents
Else
MsgBox "Nothing to clean"
End If
End Sub





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Reed wrote :
 

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

Back
Top