Friday, March 24, 2017

Finding last row, last column, and last used cell

make sure you declare the variable where you want to store the last row as long:

e.g:

Dim lrow As Long


Find last row:

lRow = Cells(Rows.Count, 1).End(xlUp).Row
where it says cells(rows.count, 1); the 1 refers to the column to be used to get the last row, e.g if you want to find the last row using the values in column D, then you would replace 1 by 4.



Find last column:

lCol = Cells(1, Columns.Count).End(xlToLeft).Column
Last Used Cell:
MsgBox Range("A1").SpecialCells(xlCellTypeLastCell).Address
https://www.excelcampus.com/vba/find-last-row-column-cell/

Tuesday, March 21, 2017

Resources

http://www.excelfunctions.net/
https://www.excelcampus.com/vba
http://www.accountingweb.com/technology/excel
http://www.cpearson.com/Excel/Topic.aspx
excelforum.com

http://analystcave.com/
http://www.vb-helper.com/index_categories.html

https://excelhelphq.com/


http://bernicezhao.blogspot.ca/p/my-resources.html

http://wellsr.com/vba/

https://trumpexcel.com/blog/

https://trumpexcel.com/excel-functions/


Windows API:
http://www.techrepublic.com/blog/10-things/10-plus-of-my-favorite-windows-api-functions-to-use-in-office-applications/
https://msdn.microsoft.com/en-us/library/office/aa165081(v=office.10).aspx
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/com-interop/walkthrough-calling-windows-apis
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/com-interop/walkthrough-calling-windows-apis
http://allapi.mentalis.org/vbtutor/api1.shtml
http://vbadud.blogspot.ca/2007/06/show-all-processes-using-vba.html






IFNA

The Excel IFNA function tests if an initial supplied value (or expression) evaluates to the Excel #N/A error. If so, the function returns a second supplied value; Otherwise the function returns the first supplied value.

http://www.excelfunctions.net/excel-ifna-function.html


Convert a number to text e.g. for vlookup

e.g. if your number is in A2, then:

=A2&""

Sunday, March 19, 2017