property for blank cell?

Pjam

Board Regular
Joined
Jun 4, 2008
Messages
139
anyone know the macro property to make a cell blank?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Range("A1").Clear

Or Range("A1").ClearContents

Or Range("A1").value = vbNullString

Or Range("A1").value = Empty

I suppose all of the above would work. I use the first or second most of the the time - Clear gets rid of everything, ClearContents leaves formatting in the cell.

HTH
 
Upvote 0
Thanks, Is there a way to just reference cells with values in them on a
worksheet. kinda like if i wanted to just reference my range of i would use usedRange ?
 
Upvote 0
A lot depends on your purpose. Can you be more specific about what you want to do? In addition to the UsedRange property, you also have the CurrentRegion property, specialCells method, and the typical arsenal of range-defining and cell-finding statements, all of which can be used to define the range of cells you are interested in.

To clear the entire sheet, simply:
Worksheets("Sheet1").Cells.Clear
Or Worksheets("Sheet1").Cells.Delete

That would take care of cells with values ;)

Regards,
AB

Here's some info on special cells if it helps.
http://www.ozgrid.com/VBA/special-cells.htm
Also check out the VBA help files on UsedRange and CurrentRegion.
(Also: type "Locate and select cells that meet specific conditions" in the help box in regular excel to understand better what Excel is doing with some of these selection options)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,988
Members
448,538
Latest member
alex78

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
Back
Top