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”) […]

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 […]

Microsoft Visual Basic Error – Methord or Data member not found

Microsoft Visual Basic Error – Methord or Data member not found This error is generated when you call a function that is set a private. To resolve the issue change the function from Private to Public. Public Sub LoadScripts()     Call BlockInactiveTags.BlockInactiveTags     Call CatToTag.CatToTag     Call DataLoadArticles.DataLoadArticles     Call DataLoadCustomer.DataLoadCustomer     Call RenameTags.RenameTags     […]

How to call a procedure or module in another procedure or module VBA Excel

Here is the solution to call a procedure or module in another procedure or module VBA Excel. Code from Module 1 Public Sub ScriptFooter(FileNum As Integer) Print #FileNum, “</tbody></table>” End Sub Code from Module 2. Public Sub CommandButton1_Click() ‘code written on 21/01/2010 by Pavandeep Puddupakkam Dim FileNum As Integer Sheets(“Search”).Activate FileNum = FreeFile ‘ next […]

How to write a function and call a function in excel macros

Here I am creating a function called¬† form1(FileNum As Integer) and calling the function in g() using Call form1(FileNum) Sub form1(FileNum As Integer) Workbooks.Open (“c:\test\test1.xlsx”) Sheets(“Sheet1″).Activate Open “C:\test\test1.html” For Output As #FileNum ‘ creates the file if it doesn’t exist If Cells(1, 1) <> “” Then Title = Cells(2, 2) URL = Cells(1, 2) Print […]