ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear blank cells (https://www.excelbanter.com/excel-programming/321355-clear-blank-cells.html)

Reed[_3_]

Clear blank cells
 
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



Chip Pearson

Clear blank cells
 
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


"Reed" wrote in message
...
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





Reed[_3_]

Clear blank cells
 
Is it possible to make a macro that automatically selects the cells?

Thanks,

Mike



"Chip Pearson" wrote in message
...
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


"Reed" wrote in message
...
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






Phillip[_5_]

Clear blank cells
 
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 wrote:
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



keepITcool

Clear blank cells
 

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 :

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



All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com