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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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)
 
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)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top