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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heres an Easy 1!

Status
Not open for further replies.

Newbie311

Programmer
Oct 6, 2003
30
GB
Hi There,
I just need to modify the following code to display the first value it finds.I.E there are 2 bios dates in a text file however i just need the first instance.P.S currently the statement below returns me 2 instances of bios date and i only require the first 1 found!
Much Appreciated if you can help!
Thanks

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

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
 
If InStr(1, GetLine, "BIOS Date") > 0 Then 'Search for Bios Date

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
Exit Sub



End If
adding exit sub to the above might work for you...

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top