Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default change a value on a string of data

Thank you!!

One problem when I convert back the file from Excel to .txt some of the
lines (not all)
Have a " as the 1st caracter in the line.

That happens only in the .TXt file as if i look in the excel file I can not
see the "

Could you please help?



"Tom Ogilvy" wrote:

For Each Cell In Range("A1:A10")
s = Cell.Value
if left(s,1) = "1" then
i = 23
else
i = 29
end if
iloc = InStr(i, s, " ", vbTextCompare)
s1 = Left(s, i-1)
s3 = Right(s, Len(s) - iloc)
s2 = "***** "
Cell.Value = s1 & s2 & s3
Next

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote in message
...
Sub AABB()
For Each Cell In Range("A1:A10")
s = Cell.Value
iloc = InStr(23, s, " ", vbTextCompare)
s1 = Left(s, 22)
s3 = Right(s, Len(s) - iloc)
s2 = "***** "
Cell.Value = s1 & s2 & s3
Next
End Sub

--
Regards,
Tom Ogilvy

"adiacc" wrote:

Hi my 1st post so I hope I make sense:
I have strings of data like the EG below
000000000000 0000 000 Andrea xxxx 222 3333
000000000000 0000 000 Louise xxxx 222 3333
So what I need to do is change the names to ***** the names can be
different
but the field is always the same number of characters and in the same
location in the line
The file is a TXT file.

Any idea?
Thank you
Andrea




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 change color within string? Eric Excel Discussion (Misc queries) 2 March 18th 10 08:33 AM
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
bad data when i change string to double [email protected] Excel Programming 3 August 4th 06 06:03 PM
Change value in a string alvin Kuiper Excel Programming 5 February 13th 06 09:29 AM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM


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