Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49895

Looping through each row

$
0
0
I'm trying to get this stupid loop to do something. Sorry it's such a lame question, but I don't really know what I'm doing here. I want to do the tasks listed in each row, go to the next row, do the same tasks, and quit when column A is empty. No matter what I try I cant get it to work.

Code:

Do
      with objWorkBook.Worksheets("Sheet1").Cells(r, 1)
         
                'msgbox r
                objWorkBook.Worksheets("Sheet1").Cells(r, 1).select
                CellValue = objWorkBook.Worksheets("Sheet1").Cells(r, 1).value
                'msgbox CellValue
               
               
               
                sess0.screen.moveto 21,3
                sess0.screen.sendkeys("<Tab>DIFDI" & CellValue)
                sess0.screen.sendkeys("<Enter>")
               
                Result=sess0.screen.GetString(11, 10, 24)
                objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = Trim(Result)
               
                'msgbox Result
               
                msgbox R
                Exit Do
           
 
        End With
       
  r = r+1
 
 Loop


Viewing all articles
Browse latest Browse all 49895

Trending Articles