Change date format to australian data format with excel macro VBA.

In this example I will tell you how you can change the date format to Australian data format (DD-MMM-YYY) with excel macro VBA.

Normally when you print the date from a excel spread sheet to a text file the data is printed as dd/mm/yyyy.

if you have the date 10/06/2010 in cells(1,1)  using Format(Cells(1,1), “dd-mmm-yyyy”) you can print the date as 10-Jun-2010.

Print #FileNum, Format(Cells(1, 1), “dd-mmm-yyyy”)

How to extract the first 100 characters from a excel cell using vba

In this example I will tell you how you can extract the first 100 characters from a excel cell using vba

Say Call A1 has the value In this example I will tell you how you can extract the first 100 characters from a excel cell using vba

In Cell B1 write the function =MID(A1,1,100). You will see cell B1 will have the text In this example I will tell you how you can extract the first 100 characters from a excel cell using.

Using Excel VBA Trim function with xpath in selenium

Using Excel VBA Trim function with xpath in selenium.

Abstract = "//textarea[@id='ctl00_MainContent_ArticleTabPages_txtAbstract'][contains(text(),'" & Trim(Cells(r, 4)) & "')]"

The text in the excel cell had a space at the end of the string and
this was causing the scripts to fail as the string did not match with
the text on the webpage. I then used the trim function to remove the
space at the begining and end of the string.

Print #FileNum, "<tr>"
Print #FileNum, "<td>verifyElementPresent</td>"
Print #FileNum, "<td>"; Abstract; "</td>"
Print #FileNum, "<td></td>"

Print #FileNum, "</tr>"