Wednesday, 16 January 2013

To get the column and row count of Excel sheet

To get the column and row count of Excel sheet
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set ObjExcelFile1 = objExcel.Workbooks.Open("N:/Proton.xls")
Set ObjExcelSheet1 = ObjExcelFile1.Sheets("SOS_Mobile")
Row_Count = ObjExcelSheet1.UsedRange.Rows.Count
Column_Count = ObjExcelSheet1.UsedRange.Columns.Count
msgbox "Row Count is "&Row_Count& vbNewline &"Column Count is "&Column_Count
ObjExcelFile1.Close
objExcel.Quit

5 comments:

  1. So happy to be given a privilege to post a comment here. You have a wonderful site. Thank you for the effort to publish this.

    Arianne
    www.gofastek.com

    ReplyDelete
  2. Cotton Affairs is an Australian owned family business founded in Sydney, Australia in 1995.
    It specialises in designing, sourcing and bringing to market a wide diversity of textile homeware products.

    cotton sheet sets

    ReplyDelete
  3. Good One,

    Can you please assist with the function that can paste multiple data in different sheet during run-time

    ReplyDelete

  4. Bedding N Bath is an Australian-owned family business founded in Sydney, Australia in 1995.
    It specializes in designing, sourcing, and bringing to market a wide diversity of textile homeware products.

    cotton sheet sets

    ReplyDelete