LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Find & replace string in text

Be, I'm glad to help. Thanks for the feedback! James

"BeSmart" wrote in message
...
Hi James
Wow - both your postings worked beautifully and are extremely helpful for
me
- your help is very much appreciated. I'll now go and study your code to
understand it better and learn from your smart work.
--
Thank for all your help
BeSmart


"Zone" wrote:

Be, the textbox was easier than I thought. Copy this code and paste in
the
userform module. It assumes your textbox is named TextBox1. If that's
not
right, change all the TextBox1 to the name of your textbox. Also, be
sure
to read my previous post! James

Private Sub TextBox1_Change()
Dim s As String
s = Me.TextBox1
s = Replace(s, "[", ChrW(780))
s = Replace(s, "]", ChrW(768))
s = Replace(s, "<", ChrW(772))
s = Replace(s, "", ChrW(769))
s = Replace(s, "~", ChrW(776))
Me.TextBox1 = s
End Sub

"Zone" wrote in message
...
Be, I'll see what I can do with the userform and post back. In the
meantime, this will show you the ChrW characters. Open a new workbook.
In cell U1, enter
Font
In cell U2, enter
Tahoma
In cell U3, enter
Lead character
In cell U4, enter
b
Insert a standard module, copy the code below and put it in there.

Sub ShowChrs()
Dim k As Long, j As Long, c As String
Columns("a:t").ClearContents
c = [u4]
Cells.Font.Size = 13
For j = 1 To 21 Step 2
Columns(j).Font.Name = "Arial"
Columns(j + 1).Font.Name = [u2]
Next j
For j = 0 To 9
For k = 1 To 200
Cells(k, 1 + (j * 2)) = k + (j * 200)
Cells(k, 2 + (j * 2)) = c & ChrW(k + (j * 200))
Next k
Next j
Columns.ColumnWidth = 6
[a1].Select
End Sub

Run the routine to see the characters. I included a "lead character"
with
each ChrW character because some of the ChrW characters won't show
unless
there's a character before them. To get rid of the lead character,
make
cell U4 empty. You can get a different font by putting a different
font
name in cell U2. Make sure you spell it right or you'll get weird
results.
James

"BeSmart" wrote in message
...
Thanks James

I actually included the same coding at the end of the "click" code
that
activates the userform- i.e. once the data appears on my worksheet it
converts the characters into symbols, but I would still like the user
to
be
able to see the symbols in the userform text box as they type if
possible.

In terms of my experience with userforms - I'm teaching myself so it's
minimal, but I'm assuming I double click on the textbox field on the
userform
(to go into it's code) and enter change code in there - but I'm not
sure
what
code I write to convert the character as it's typed in the field.

--
Thank heaps for your help
BeSmart











 
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
Find and replace part of a text string [email protected] Excel Discussion (Misc queries) 2 July 10th 06 10:34 PM
Find and Replace in a DDE string!!! Mark Dullingham Excel Programming 5 May 4th 06 01:12 AM
Find a string between two delimeters and replace with text Jeff[_50_] Excel Programming 2 May 2nd 06 07:15 PM
Excel - Find & Replace text in a string bklim Excel Programming 5 June 14th 05 07:37 AM
Excel - Find & Replace text in a string bklim Excel Worksheet Functions 1 June 14th 05 06:42 AM


All times are GMT +1. The time now is 12:30 PM.

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"