Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default CLEAN on whole Worksheet

Hi guys/Girls

Is there a way to apply the CLEAN function to an entire worksheet?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default CLEAN on whole Worksheet

Public Sub Test()
Dim cell As Range

For Each cell In ActiveSheet.UsedRange
If Not cell.HasFormula Then
cell.Value = Application.Clean(cell.Value)
End If
Next cell
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Gareth - Network analyst."
wrote in message ...
Hi guys/Girls

Is there a way to apply the CLEAN function to an entire worksheet?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default CLEAN on whole Worksheet

Select the cells you want to clean and run:

Sub doit()
For Each r In Selection
If Application.WorksheetFunction.IsText(r) Then
r.Value = Application.WorksheetFunction.Clean(r.Value)
End If
Next
End Sub
--
Gary''s Student - gsnu200753


"Gareth - Network analyst." wrote:

Hi guys/Girls

Is there a way to apply the CLEAN function to an entire worksheet?

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
Trim and clean Wanna Learn Excel Discussion (Misc queries) 2 January 30th 07 07:08 PM
Clean Up Data ultra_xcyter Excel Discussion (Misc queries) 2 August 11th 06 08:49 PM
End of run 'clean up" . . . Wayne Knazek Excel Discussion (Misc queries) 2 July 1st 06 03:55 PM
CLEAN Formula Kristen Excel Worksheet Functions 1 April 12th 05 11:48 PM
Clean lines Gfhcouriers Charts and Charting in Excel 1 December 10th 04 11:09 AM


All times are GMT +1. The time now is 03:19 AM.

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"