ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I select a whole range and delete the contents of the cells? (https://www.excelbanter.com/excel-programming/300269-how-do-i-select-whole-range-delete-contents-cells.html)

benthomas_duck

How do I select a whole range and delete the contents of the cells?
 
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)

Foss

How do I select a whole range and delete the contents of the cells?
 
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)
.


benthomas_duck

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

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
Can someone please tell me how I select a whole range and

delete the contents of the cells in that range? (in VB
code




All times are GMT +1. The time now is 07:06 AM.

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