LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Macro that returns a specific number of characters from a text str

I did a search and replace, looking for double quotes and replacing
with nothing, which worked. If you REALLY need a macro to do it, this
one will:

Sub RemoveQuotes()
Dim rCell As Range
Dim CellVal As String
Dim NewVal As String
Dim K As Byte
Application.Calculation = xlCalculationManual

For Each rCell In Selection.Cells
CellVal = Trim(rCell.Value)
rCell.ClearContents
For K = 1 To Len(CellVal)
If Asc(Mid(CellVal, K, 1)) < 34 Then
NewVal = NewVal & Mid(CellVal, K, 1)
End If
Next K
rCell.Value = NewVal
NewVal = ""
Next rCell
Application.Calculation = xlCalculationAutomatic
End Sub

 
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
Finding cells with a specific number of characters Kamran Excel Discussion (Misc queries) 6 March 29th 06 11:04 PM
Text String - Specific Characters Kiser Excel Worksheet Functions 6 February 10th 06 02:43 AM
number returns only two decimal places after I change from text quale Excel Discussion (Misc queries) 5 December 8th 05 08:22 PM
trim a string by specific number of characters windyoldman Excel Discussion (Misc queries) 2 July 13th 05 01:53 PM
how do I highlite text within a cell (specific characters) tim Excel Discussion (Misc queries) 1 May 20th 05 05:23 AM


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