Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting cell number from excel sheet
#4
Not Solved
Try this code

Code:
Set ObjExcel = CreateObject("Excel.Application")
ObjExcel.visible = TRUE
Set sWorkbook = ObjExcel.Workbooks.Open("z:\Sample1.xls")
Set sWorksheet = sWorkbook.Worksheets("Sheet1")

rCnt = sWorkbook.Worksheets("Sheet1").UsedRange.Rows.Count
cCnt = sWorkbook.Worksheets("Sheet1").UsedRange.Columns.Count
For i = 1 to rCnt

    For j = 1 to cCnt

        cValue = sWorkbook.Worksheets("Sheet1").Cells(i,j).Value
        If cValue = "Result" Then
            Print "Row Number - " & i & "  Column Number " & j
        End If

    Next

Next
Reply


Messages In This Thread
RE: Getting cell number from excel sheet - by ssvali - 07-27-2012, 04:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading data from excel sheet serenediva 1 9,620 03-03-2017, 10:07 AM
Last Post: vinod123
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,861 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
Smile Importing Excel sheet - Reference Values are not recognized michiusa69 3 7,884 01-23-2015, 02:36 AM
Last Post: lkng2001
  How to pass a date from Excel sheet to web form revati.shendure 1 2,968 11-27-2014, 11:54 AM
Last Post: revati.shendure
  clearing excel sheet values beejfred 1 7,514 09-25-2014, 11:43 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 2 Guest(s)