VBA Clear Cell Contents

T

towl

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").Clear

End Sub

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

Bob Phillips

Use Clearcontents instead of Clear

--

HTH

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

Zack Barresse

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top