How do I select a whole range and delete the contents of the cells?

B

benthomas_duck

I thankyou in advance

Can someone please tell me how I select a whole range and delete the contents of the cells in that range? (in VB code)
 
F

Foss

Hi there,

How about this:

Sub DeleteCells()
'use this to delete contents without ever selecting the
cell (faster)
Range("B10:C12").ClearContents

'use this to select the range first then delete the
contents (if you need the range to be selected)
Range("B10:B12").Select
Selection.ClearContents
End Sub

Any use?

Cheers,
Foss
-----Original Message-----
I thankyou in advance.

Can someone please tell me how I select a whole range and
delete the contents of the cells in that range? (in VB
code)
 
B

Benthomas_duck

Spot on thanks for that

----- Foss wrote: ----

Hi there

How about this

Sub DeleteCells(
'use this to delete contents without ever selecting the
cell (faster
Range("B10:C12").ClearContent

'use this to select the range first then delete the
contents (if you need the range to be selected
Range("B10:B12").Selec
Selection.ClearContent
End Su

Any use

Cheers
Fos
-----Original Message----
I thankyou in advance
delete the contents of the cells in that range? (in VB
code
 
Top