ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell format (https://www.excelbanter.com/excel-programming/371907-re-cell-format.html)

Jim Thomlinson

Cell format
 
You will need to modify the sheet and the range but this should be close...

Public Sub FindJustNumbers()
Dim rng As Range
Dim wks As Worksheet

Set wks = ActiveSheet
On Error Resume Next
Set rng = wks.Range("A1:D5").SpecialCells(xlCellTypeConstant s, xlNumbers)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "No Numbers"
Else
rng.Select
End If
End Sub
--
HTH...

Jim Thomlinson


"Christmas May" wrote:

To all,

If you enter "965-0001" in cell A1, "2" in cell A2, "=A1+1" into cell B1 and
"=A2+1" into cell B2, "#VALUE!" in cell B1 and "3" in cell B2.

I'd like to run a macro to remove all of the cells in a long list that are
simply a number like cell A2 above, while retaining the cells that have data
like cell A1 above. However, I'm unsure how to determine the difference.

Sincerely,

Christmas May



All times are GMT +1. The time now is 11:58 PM.

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