Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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)
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select a range of rows to delete Donna[_3_] Excel Worksheet Functions 2 January 26th 10 07:32 PM
Delete contents unlocked cells RobN[_3_] Excel Discussion (Misc queries) 9 December 13th 07 10:34 PM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
Delete contents of cells mikespeck Excel Worksheet Functions 3 July 27th 06 03:16 PM
How do I select a range if one cells contents is equal to another KHarrison Excel Discussion (Misc queries) 2 December 20th 04 09:35 PM


All times are GMT +1. The time now is 11:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"