Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to apply CLEAN func.

Hi there,

How to creates macro that use the clean function for a selection in a
spreadsheet ?

Also how to remove just the ? mark from a selection in a spreadsheet?

I have a spreadsheet the hold names with ? at the and of a cell and I wanted
to remove it without removing the name.

Thanks an advanced

Oded Dror
Email:




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to apply CLEAN func.

#1.

Option Explicit
Sub testme()

Dim myRng As Range
Dim myCell As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells _
.SpecialCells(xlCellTypeConstants, xlTextValues))
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "nothing to clean in that selection"
Exit Sub
End If

For Each myCell In myRng.Cells
myCell.Value = Application.Clean(myCell.Value)
Next myCell

End Sub

#2. Select your range and edit|replace. But use ~? (tilde question mark) in
the Find What box.

The question mark is a wild card. The tilde tells excel that you really want a
question mark.

(same technique for both the asterisk and tilde (~* and ~~).)



Oded Dror wrote:

Hi there,

How to creates macro that use the clean function for a selection in a
spreadsheet ?

Also how to remove just the ? mark from a selection in a spreadsheet?

I have a spreadsheet the hold names with ? at the and of a cell and I wanted
to remove it without removing the name.

Thanks an advanced

Oded Dror
Email:


--

Dave Peterson
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
How to use the $ to do global func =ave($1:$1) more details? AlanY Excel Discussion (Misc queries) 10 June 30th 06 01:19 AM
How 2 sum the abs values of several cells w 1 func in XL. bob Excel Worksheet Functions 1 February 9th 06 08:25 PM
How 2 sum the abs values of several cells w 1 func in XL. bob Excel Worksheet Functions 1 February 9th 06 08:21 PM
Help pls! Max func to display value of different cell? Impakt Excel Worksheet Functions 5 February 12th 05 04:06 AM
start a macro from a func FTCA Excel Programming 4 October 19th 03 09:40 PM


All times are GMT +1. The time now is 05:45 PM.

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"