vba to blank cells with criteria

wigarth

New Member
Joined
Apr 16, 2016
Messages
24
Hi!

I am sure there is a 10 line easypeasy macro to solve my issues here...
The problem is that I (and google) lack the expertise to find it.

I have a sheet with a column ("D") and it has some cells that needs to be blanked.
The cells that are to be "Blanked" are cells contaning "numbers only"
The cells to keep, contains only text or numbers and text in the same cell.


So basically i need to make a macro that loops throgh area D1:D100000 and blank out cells that contains only numbers and skips the ones containing text/text and numbers
With the word "Blanked" I mean "" (Make the cell empty, not hide/delete it)


In exaple:

Cell D12 ---> "17551" <-- make this cell blank, replace with ""
Cell D13 ---> "Product12" <-- Skip this cell
Cell D14 ---> "Region8" <--- Skip this cell
Cell D15 ---> "64665" <-- make this cell blank, replace with ""
Cell D16 ---> "4th annual summary" <-- Skip this cell
Cell D17 --->"323" <-- make this cell blank, replace with ""

I have several macros that can remove numbers, but they remove the numbers from the cells that contain text as well... Anyone with some advice here?

Best reggards:
Wigarth
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
3,306
Office Version
  1. 365
Platform
  1. Windows
Try:
VBA Code:
Sub try333()
Range("D1:D100000").SpecialCells(xlConstants, xlNumbers).ClearContents
End Sub
 
Solution

Forum statistics

Threads
1,141,402
Messages
5,706,245
Members
421,433
Latest member
yash0468

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top