Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I clear a cell contents but not the formula behind it | Excel Discussion (Misc queries) | |||
Clear Contents Of Cell If Value = 0 or Error | Excel Worksheet Functions | |||
vb to clear cell contents | New Users to Excel | |||
Clear cell contents with a button | Excel Worksheet Functions | |||
MACRO TO CLEAR CELL CONTENTS | Excel Programming |