Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GVT
 
Posts: n/a
Default Need macro to delete all text cells in an Excel range

When I import a table from another program into Excel, the blank cells in the
original program look blank, but Excel imports them as text. I need help
writing a macro that will identify the cells that contain text and delete
their contents.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default Need macro to delete all text cells in an Excel range

Enter:


Sub textclear()
' gsnu
Dim r As Range
For Each r In Selection
If r.Application.IsNumber(r.Value) Then
Else
r.Value = ""
End If
Next
End Sub

Select an area of the worksheet and run the macro.
--
Gary's Student


"GVT" wrote:

When I import a table from another program into Excel, the blank cells in the
original program look blank, but Excel imports them as text. I need help
writing a macro that will identify the cells that contain text and delete
their contents.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken Wright
 
Posts: n/a
Default Need macro to delete all text cells in an Excel range

Use Dave McRitchies Trimall macro, and it will do a lot more besides:-

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------


"GVT" wrote in message
...
When I import a table from another program into Excel, the blank cells in
the
original program look blank, but Excel imports them as text. I need help
writing a macro that will identify the cells that contain text and delete
their contents.



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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Macro to Delete blank cells GarToms Excel Worksheet Functions 1 January 26th 06 07:39 PM
How to I copy text from a range of cells to another single cell? WRT Excel Discussion (Misc queries) 2 December 18th 05 06:17 AM
I want Excel to allow cells with formulas and unrelated text blueboy Excel Discussion (Misc queries) 9 March 4th 05 12:22 AM
How do you delete one cell from a range of protected cells Cgbilliar Excel Worksheet Functions 2 November 3rd 04 10:42 PM


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