Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default The 'clear' instruction in VBA

Very quick question I hope.

I have a macro in which the following instruction appears:

Selection.Clear

The only problem is that everything is cleared, but in fact I want the
formatting of the cell to remain (for example, the borders, number
formatting, etc.).

If anyone can tell me how to adapt the instruction so that formatting
remain, that would be much appreciated.

Thanks

Mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default The 'clear' instruction in VBA

Use ClearContents instead of Clear.

--

Vasant

"Mike" wrote in message
...
Very quick question I hope.

I have a macro in which the following instruction appears:

Selection.Clear

The only problem is that everything is cleared, but in fact I want the
formatting of the cell to remain (for example, the borders, number
formatting, etc.).

If anyone can tell me how to adapt the instruction so that formatting
remain, that would be much appreciated.

Thanks

Mike




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default The 'clear' instruction in VBA

Cheers

Mike

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Use ClearContents instead of Clear.

--

Vasant

"Mike" wrote in message
...
Very quick question I hope.

I have a macro in which the following instruction appears:

Selection.Clear

The only problem is that everything is cleared, but in fact I want the
formatting of the cell to remain (for example, the borders, number
formatting, etc.).

If anyone can tell me how to adapt the instruction so that formatting
remain, that would be much appreciated.

Thanks

Mike






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
Transfer a name from one cell to another but leave clear if clear? Scoober Excel Worksheet Functions 3 May 22nd 09 02:55 AM
What Instruction? johnsail Excel Discussion (Misc queries) 3 March 9th 09 09:51 AM
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
How do I delete an instruction box? Priscilla Excel Worksheet Functions 2 June 24th 07 06:21 AM
BAR CODE Instruction Hmagallanes Excel Programming 7 February 17th 04 07:55 PM


All times are GMT +1. The time now is 10:23 AM.

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

About Us

"It's about Microsoft Excel"