Code snippets VBA
Oct3Difficulty: 




At the moment I’m working on the automation of a MS Excel sheet.
Here are some handy code snippets & tips:
Not Equal, In most programming languages you’ll write this as:
//not equal operator in javascript x != y;
In vb script / vba this is different:
'Not equal operator in vb script x <> y
You can use the vb messagebox for debugging information. The biggest disadvantage is that you
have to click every time on the ok button. – Imagine if your workbook contains more then 1000
fields and somewhere the data is not correct.
For this you want the Debug statement.
Open the Immediate Window from MS Visual Basic Code screen > View. (CTRL + G). Write in your code the following line:
Debug.Print "Debug message here."
Find the last filled row
'Find the last filled row
maxRowNumber = Sourcedoc.Cells.SpecialCells(xlCellTypeLastCell).row
Posted in vba |excel, / vba, / visual basic
» 1 Comment, post your comment now. »
One Response to “Code snippets VBA”
People should read this.














Comments