LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Strip out data using VBA

Sounds like some data in column A which is not like the others.

Try the code with a workbook that has just one sheet.
If it still is a runaway, try removing half of the rows.
If it still is a runaway, try removing half again until you discover what
data is complicating it.


wrote in message
...
Rob:

I try to use this macro, but was in the loop, I can
not get out the program, it was stop in end if. any idea?

thanks for the help

Lillian
-----Original Message-----
Sub testit()
Dim wks As Worksheet, rng As Range, i As Long,

strTemp As String

For Each wks In Worksheets
For Each rng In Range(wks.Cells(1, 1), wks.Cells

(Rows.Count,
1).End(xlUp))
i = InStr(1, rng.Value, "L#")
If i 0 Then
strTemp = Mid(rng.Value, i)
i = 3: Do Until Not IsNumeric(Mid

(strTemp, i, 1)): i = i +
1: Loop
strTemp = Mid(strTemp, 1, i - 1)
MsgBox rng.Address(External:=True) &

vbNewLine & strTemp
End If
Next
Next
End Sub

"Lillian" wrote in

message
...
I have one excel spread sheet that have 4 sheets, which
is sheet1, sheet2, sheet3, sheet4, on each sheets of
columns A that has data like this "
C#1251934538L#0000000169R#00002P#00001", I need to

strip
out C#1251934538 and R#00002P#00001, all I need is
L#0000000129, another word is before L need to strip

out,
and after 9 from R need to strip out as well. how to
write the macro to do that, also this need to in the

loop
for sheet1, sheet2, sheet3, sheet4.

Simple word is the data I need is from L to last

numeric
no, before R. which is L#0000000129

thanks.


Lillian



.



 
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
STRIP CHARACTERS rpick60 Excel Worksheet Functions 7 December 16th 07 04:39 AM
How do I strip out some parts of a column of text data? footballcmr2 Excel Discussion (Misc queries) 3 July 1st 05 07:20 PM
TAB STRIP icebreaker914 Excel Discussion (Misc queries) 1 April 16th 05 01:24 PM
tab strip icebreaker914 New Users to Excel 1 April 16th 05 01:24 PM
get rid of tabs strip Erin[_3_] Excel Programming 4 July 29th 03 07:08 PM


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