• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Delete text from column A

spk1009

New Member
I am trying to delete (clear) cell content from the bottom rows where text exists...


I started with this code but it's not flexible...


Sub delrows()

'Delete rows with text

Sheets("Prefinal").Select

Range("A1").Select

Selection.End(xlDown).Select

Range("A76:A85").Select

Range("A85").Activate

Selection.ClearContents

ActiveWorkbook.Save

End Sub


Any help is appreciated.


Example:


Column A


1 123456

2 123456

3 123456

4 123456

5 123456

6 123456

7 text1

8 text2

9 text3
 
Hope this code help you much...below code clear the text contained cells in Column - A


Sub ClearTextData()

Dim rng As Range

Dim cel As Range


Set rng = Range("A1:A65536")'assign the range up to the data have

For Each cel In rng

If WorksheetFunction.IsText(cel.Value) Then cel.ClearContents

Next cel

End Sub
 
Back
Top