Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Differentiate between duplicates

Status
Not open for further replies.

Newbie311

Programmer
Oct 6, 2003
30
GB
Hi There,Im using the code below to search for BiosDate in a particular textfile.The problem im getting is the fact that there are more than 1 bios date and i only need the first instance.What can i add to this code to only return the first instance of BIOS Date?
Thanks!

If InStr(1, GetLine, "BIOS Date") > 0 Then 'Search for date

ActiveCell.Offset(b, 2) = "TRUE"
ActiveCell.Offset(b, 2).Value = GetLine
ActiveCell.Offset(b, 2).Value = Trim(Mid(ActiveCell.Offset(b, 2).Value, Len("BIOS Date: "), 15))
b = b + 1
End If
 
That one cell, activecell.offset(b,2), can only have one value, so to assign three different values to it in three subsequent lines isn't so helpful. Perhaps this will help:

found=false
do while not eof(1) and not found
line input#1, getline
p=instr(getline,"BIOS Date")
if p>0 then
activecell.offset(b,2)=trim(mid(getline,p+10))
found=true
end if
loop



Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top