Hi All & Good Day,
I'm student doing my attachment. I've encounter this problem and I really need some help here.
Please kindly help or share any knowlegde if u can. I will be very greatful for any help given. THanks a million in adv.
Problem:
I've this junk of code and what i need to extract is the ItemID after swItem= but there main problem here is i only need the first part which highlight in blue.
Therefore i'm wondering if it's possible to write a VBA which will find the HTML tag
<aclass="udrlinesmall then extract the inform within the which wildcard happen to be <XXXXXXXXXX> and inside the wildcard find the second wildcard which is swItem= then extract the ItemID = "MTX-c380636094ed4c24a5a22b6542" and paste in in a new doc or at the bottom of the doc.
*NOTE : There is more then "swItem=" therefore it need to be inside the <aclass="udrlinesmall xxxxx....> tag
Really thanks everyone in adv. This will be great different in my grade for attachment pls kindly help if can. THANK YOU!
Code:<trbgColor=#e7e7e7> <tdalign="left"><aclass="udrlinesmall" href="SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=15351&prodSeriesId=1121474&prodNameId=3279719&swEnvOID=4026&swLang=8&mode=2&taskId=135&swItem=MTX-c380636094ed4c24a5a22b6542">Citrix XenServer Hot Fix </a></td> <tdclass="small" align="left">4.1.0-11501<br>19 Nov 2008</td> <tdclass="small" align="left">282.8</td> <tdclass="small" align="left">56K: >8h<br>512K: 1h</td> <tdclass="small" align="left"><ahref="SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=15351&prodSeriesId=1121474&prodNameId=3279719&swEnvOID=4026&swLang=8&mode=2&taskId=135&swItem=MTX-772f8a7295c0448c9f333f9d9a" class="udrline">4.1.0-9514</a><br>15 Jul 2008</td> <tdalign="left"><formaction="SoftwareDownloadEventHandler.jsp?redirectReason=SWD_FTP_Request&swItem=MTX-c380636094ed4c24a5a22b6542&prodSeriesId=1121474&prodLine=SY&targetPage=ftp%3A%2F%2Fftp.hp.com%2Fpub%2Fsoftlib2%2Fsoftware1%2Fpubsw-windows%2Fp702010714%2Fv50434/hpxs-hotfix-11501-b1.zip&filesize=296496139" method="post"><inputclass="primButton" type="submit" value="Download »" name="download" style="float:left;" title="Download" onclick='if(window.s_gs){s_linkType="d";s_lnk=s_co(this);s_linkName="SY-hpxs-hotfix-11501-b1.zip";s_prop2="SY";s_prop4="SOAR-MTX-c380636094ed4c24a5a22b6542";s_prop5="1121474-HP ProLiant ML370 G5 Server series";s_gs("hphqglobal,hphqWWsupportBSD")}'"/></form></td> </tr> </table>
Noobie here to LEARN
anyone? any suggestion?
Noobie here to LEARN
Could you post a sample file - it's quite hard to follow where the data is located what your desired output is etc...
In VBA terms you could possibly look at Regular Expressions and or the simpler Split method, ie:
You can iterate through vString until such time as the value is the swItem variable, eg:Code:Dim strHTML As String, strOutput As String, lngString As Long, vString strHTML = your HTML string... vString = Split(strHTML,"&")
EDIT: Doh - I didn't see this was in Word ... apologies...Code:For lngString = LBound(vString) To UBound(vString) Step 1 If InStr(vString(lngString), "swItem=") Then strOutput = Split(vString(lngString), "=")(1) Exit For End If Next lngString
Last edited by DonkeyOte; 05-22-2009 at 04:32 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Is ok with excel also.. actually it's a HTML file.. i'm using it source to extract the link.
Here the sample
http://www.easy-share.com/1905311225/PLease_Help.rar
Last edited by whousedmy; 05-22-2009 at 05:49 AM.
Noobie here to LEARN
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks