ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find a string in excel (https://www.excelbanter.com/excel-programming/276391-find-string-excel.html)

J

Find a string in excel
 
Hi,

I have a txt list that looks likes this:

Name: Dave Foo
Address: 80 address street
Phone: &#
Weight: 190
Height: 6


Name: Blab Boing
Address: 320 Sycamore
Phone: &#
Weight: 300
Height: 4


This is repeated for each person and list is 1000 entries long, let's
say.
I'd like to remove everything in the list except for the address. Or
find the address and paste it onto another worksheet, or save it as
txt. I just need to isolate the address.
Not sure how to do that.

Thanks for any help

Chip Pearson

Find a string in excel
 
Try something like the following


Sub CopyAddr()
Dim DestRng As Range
Dim RowNdx As Long

'change SkipRows to number of rows between
' address lines
Const SkipRows = 7
' change RowNdx to first address row
RowNdx = 5
' change DestRng to location to which
' addresses should be copied
Set DestRng = Worksheets(2).Range("A1")

Do Until Worksheets(1).Cells(RowNdx, "A") = ""
DestRng = Worksheets(1).Cells(RowNdx, "A")
Set DestRng = DestRng(2, 1)
RowNdx = RowNdx + SkipRows
Loop
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"J" wrote in message
om...
Hi,

I have a txt list that looks likes this:

Name: Dave Foo
Address: 80 address street
Phone: &#
Weight: 190
Height: 6


Name: Blab Boing
Address: 320 Sycamore
Phone: &#
Weight: 300
Height: 4


This is repeated for each person and list is 1000 entries long, let's
say.
I'd like to remove everything in the list except for the address. Or
find the address and paste it onto another worksheet, or save it as
txt. I just need to isolate the address.
Not sure how to do that.

Thanks for any help




J

Find a string in excel (Thanks)
 
Thanks guys, appreciate the help.


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com