LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Find and Replace only the end of a cells text


try following code

Code:
--------------------

Private Sub mySub()
Dim row As Integer, col As Integer
row = 1
col = 1
Dim str As String
Dim i As Integer

While Sheet1.Cells(row, col).Value < ""
'*F0123450 --- *F*123450*
str = Sheet1.Cells(row, col).Value

If Mid(str, 3, 1) = "0" Then
str = Left(str, 2) & "*" & Mid(str, 4, Len(str))
Sheet1.Cells(row, col).Value = str
End If

row = row + 1
Wend
End Sub

--------------------



Chris
------
Convert your Excel spreadsheet into an online calculator.
http://www.spreadsheetconverter.com




--
Chris Bode
 
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 & replace with text Waheeda Ali Excel Discussion (Misc queries) 2 January 27th 09 06:52 PM
Replace can't find text dac Excel Discussion (Misc queries) 1 October 26th 07 10:26 PM
find text in cell and replace it with part of the text in that ce. jules Excel Discussion (Misc queries) 3 May 3rd 07 10:18 AM
Find & Replace in Text Box Ed Excel Discussion (Misc queries) 10 March 28th 07 03:03 AM
Find/Replace Text In Cells Rob Excel Discussion (Misc queries) 1 April 11th 05 04:01 AM


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