Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Clear Cell Contents


I have written a simple Macro to clear a cell range, however it clears
all the formats as well as the text.

All I am after is the text deleting, but not eh cell formats, as some
are in % and some currency, to drive later formulas.

The code I have is

Sub Clear_Form()
Worksheets("selectordump").Range("a2:c2,b8:b12").C lear

End Sub

anyone know what I should do just to erase the text?


--
towl
------------------------------------------------------------------------
towl's Profile: http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=477931

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default VBA Clear Cell Contents

Use Clearcontents instead of Clear

--

HTH

RP
(remove nothere from the email address if mailing direct)


"towl" wrote in message
...

I have written a simple Macro to clear a cell range, however it clears
all the formats as well as the text.

All I am after is the text deleting, but not eh cell formats, as some
are in % and some currency, to drive later formulas.

The code I have is

Sub Clear_Form()
Worksheets("selectordump").Range("a2:c2,b8:b12").C lear

End Sub

anyone know what I should do just to erase the text?


--
towl
------------------------------------------------------------------------
towl's Profile:

http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=477931



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default VBA Clear Cell Contents

Yes, Clear will clear everything including formats. If you want just text,
use ClearContents.

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"towl" wrote in message
...

I have written a simple Macro to clear a cell range, however it clears
all the formats as well as the text.

All I am after is the text deleting, but not eh cell formats, as some
are in % and some currency, to drive later formulas.

The code I have is

Sub Clear_Form()
Worksheets("selectordump").Range("a2:c2,b8:b12").C lear

End Sub

anyone know what I should do just to erase the text?


--
towl
------------------------------------------------------------------------
towl's Profile:
http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=477931



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default VBA Clear Cell Contents

Change Clear to ClearContents...
--
HTH...

Jim Thomlinson


"towl" wrote:


I have written a simple Macro to clear a cell range, however it clears
all the formats as well as the text.

All I am after is the text deleting, but not eh cell formats, as some
are in % and some currency, to drive later formulas.

The code I have is

Sub Clear_Form()
Worksheets("selectordump").Range("a2:c2,b8:b12").C lear

End Sub

anyone know what I should do just to erase the text?


--
towl
------------------------------------------------------------------------
towl's Profile: http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=477931


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VBA Clear Cell Contents

Hi towl

Use ClearContents instead of Clear

--
Regards Ron de Bruin
http://www.rondebruin.nl


"towl" wrote in message
...

I have written a simple Macro to clear a cell range, however it clears
all the formats as well as the text.

All I am after is the text deleting, but not eh cell formats, as some
are in % and some currency, to drive later formulas.

The code I have is

Sub Clear_Form()
Worksheets("selectordump").Range("a2:c2,b8:b12").C lear

End Sub

anyone know what I should do just to erase the text?


--
towl
------------------------------------------------------------------------
towl's Profile: http://www.excelforum.com/member.php...o&userid=26340
View this thread: http://www.excelforum.com/showthread...hreadid=477931



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 clear a cell contents but not the formula behind it SliderSteve Excel Discussion (Misc queries) 5 November 19th 07 11:33 PM
Clear Contents Of Cell If Value = 0 or Error carl Excel Worksheet Functions 4 July 9th 07 04:54 PM
vb to clear cell contents RichT New Users to Excel 6 June 27th 05 08:26 AM
Clear cell contents with a button KFC / A&W Boy Excel Worksheet Functions 1 March 7th 05 09:39 AM
MACRO TO CLEAR CELL CONTENTS Jay Dean Excel Programming 2 October 11th 03 02:51 PM


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