View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default 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