Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a column

Hi all,

This question is in two parts.

1) How do you clear an entire column of date in vb code?
2)Is it possible to clear an entire column excluding some cells withi
that colume? For example;

Lets say i want to clear column "A" but want to exclude "A1" and "A2
from this clear function

Is this possible? How!

Cheers al

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Clearing a column

Hi Grovessy,

To delete contents and format:

1) Columns(1).Clear

2) Columns(1).Rresize(Rows.Count-2).Offset(2).Clear

To delete contents but retain formatting, replace Clear with ClearContents.


---
Regards,
Norman.


"grovesy " wrote in message
...
Hi all,

This question is in two parts.

1) How do you clear an entire column of date in vb code?
2)Is it possible to clear an entire column excluding some cells within
that colume? For example;

Lets say i want to clear column "A" but want to exclude "A1" and "A2"
from this clear function

Is this possible? How!

Cheers all


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a column

Cheers Norman,

The first method does clear the entire column :)

Unfortunately the second one (The clear column excluding some cells
give me an error;

-Object doesn't support this property or method-

Any ideas?

Thanks agai

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Clearing a column

Hi Grovesy,

A typo! Change:

Columns(1).Rresize(Rows.Count-2).Offset(2).Clear

to:

Columns(1).Resize(Rows.Count-2).Offset(2).Clear

---
Regards,
Norman


"grovesy " wrote in message
...
Cheers Norman,

The first method does clear the entire column :)

Unfortunately the second one (The clear column excluding some cells)
give me an error;

-Object doesn't support this property or method-

Any ideas?

Thanks again


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Clearing a column


"grovesy " wrote in message
...
Hi all,

This question is in two parts.

1) How do you clear an entire column of date in vb code?


range("A1").EntireColumn.ClearContents

2)Is it possible to clear an entire column excluding some cells within
that colume? For example;

Lets say i want to clear column "A" but want to exclude "A1" and "A2"
from this clear function


range("A3","A65536").ClearContents

you can add ranges with Union
union(range("C1","C30"),range("C32","C65536")).Cle arContents

HTH
Cecil




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a column

Thanks Norman,

I should have spotted that!

You've been a great help

Chri

--
Message posted from http://www.ExcelForum.com

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
How do I find clearing items in a column in Excel? DACLEMEN Excel Discussion (Misc queries) 4 September 8th 08 09:44 PM
How do I find clearing items in a column in Excel? DACLEMEN Excel Worksheet Functions 1 June 28th 06 03:11 PM
How do I clear a column of data without clearing specific cells? EllenSwarts Excel Discussion (Misc queries) 2 April 5th 06 05:07 PM
How do I clear a column of data without clearing the formulas? EllenSwarts Excel Discussion (Misc queries) 2 March 11th 05 02:09 PM
Clearing a Column range in Multiple Workbooks Ruan[_3_] Excel Programming 1 August 15th 03 07:43 PM


All times are GMT +1. The time now is 09:04 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"