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
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
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.
ReplyDeleteArianne
www.gofastek.com
Thanks Cindy.. :)
ReplyDeleteCotton Affairs is an Australian owned family business founded in Sydney, Australia in 1995.
ReplyDeleteIt specialises in designing, sourcing and bringing to market a wide diversity of textile homeware products.
cotton sheet sets
Good One,
ReplyDeleteCan you please assist with the function that can paste multiple data in different sheet during run-time
ReplyDeleteBedding 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