need help opening text file
Sub OpenAndCopy()
Dim rng as Range, rng1 as Range
dim sh as Worksheet, bk as Workbook
set sh = Activesheet
set bk = Workbooks.Open("C:\MyFolder\Myfile.csv")
set rng = Columns(1).find(9135)
if not rng is nothing then
set rng1 = columns(1).find(9135,rng)
if not rng1 is nothing then
Range(rng,rng1).Entirerow.copy Destination:=sh.Range("A1")
else
msgbox "Second instance not found"
end if
else
msgbox "First Instance not found
End if
bk.close Savechanges:=False
End sub
--
Regards,
Tom Ogilvy
"armadeus" wrote in message
...
What I need is to open a text file, search through column A for a specific
number lets say "9135". this number will appear twice in column A so I
want
to copy everything between the instance of 9135 and paste in a worksheet
in
the next available empty row. I am not a programmer and I am completely
lost
any help would be appreciated!
Armadeus
|