Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a Row Number of Excel
#5
Solved: 10 Years, 9 Months, 1 Week ago
Hi Baba,

Try with the below code :

Code:
xlCellTypeVisible =12
set oExcel  = createobject("Excel.Application")
oExcel.visible = true
oExcel.Workbooks.Open ("C:\..\..\..\sample.xls")
Set sRange = oExcel.Range("C1", "C99").SpecialCells(xlCellTypeVisible)
temp_row=0
  For Each cell in sRange
        temp_row=temp_row+1
             If temp_row = 1 Then
                  Print "#####Column Header Row#####"
    Else
         d=split(cell.Address,"$")
         print "Filtered row # "&temp_row-1&" : "&Cell.Value &" and its Excel Row# : "&d(2)
            End If
  Next
  Filtered_Rowcount=temp_row-1
  Print "Numer of Filtered rows:"&Filtered_Rowcount
oExcel.ActiveWorkBook.Save
Set oExcel=Nothing
Note : You can also know the filetered rows count using below way too.
Code:
Msgbox sRange.Count-1
Reply


Messages In This Thread
How to get a Row Number of Excel - by bfakruddin - 01-09-2010, 07:37 PM
RE: How to get a Row Number of Excel - by Saket - 01-12-2010, 10:56 AM
RE: How to get a Row Number of Excel - by sreekanth chilam - 01-19-2010, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Searching for and selecting row in Datawindow zsl0009 0 2,676 08-04-2015, 01:02 AM
Last Post: zsl0009
  data sheet row count rushil 2 7,416 12-07-2012, 03:10 AM
Last Post: rushil
  Write Status of each row in DataTable dlaureano 2 3,266 11-29-2012, 05:53 PM
Last Post: dlaureano
  How to recognize table row and column siwani 4 4,813 04-05-2012, 05:06 PM
Last Post: verma.vik6
  How to count a repeated number in number in particular range gollsrin 1 3,428 04-28-2011, 11:41 AM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)