Skip to main content

i am trying to get specific data from an excel file, with data in multiple columns. i have written a script but when i comes to the third row of data, i suddenly jumps back to the second row and then it just keeps on going between third and second row. does anyone have experienced this and how did you solve it, if required i can submit my script so you can see how it looks 


#Rumba

i am trying to get specific data from an excel file, with data in multiple columns. i have written a script but when i comes to the third row of data, i suddenly jumps back to the second row and then it just keeps on going between third and second row. does anyone have experienced this and how did you solve it, if required i can submit my script so you can see how it looks 


#Rumba
It would be good if you can submit a code snippet to easy replicate your problem.

i am trying to get specific data from an excel file, with data in multiple columns. i have written a script but when i comes to the third row of data, i suddenly jumps back to the second row and then it just keeps on going between third and second row. does anyone have experienced this and how did you solve it, if required i can submit my script so you can see how it looks 


#Rumba
[deleted]

i am trying to get specific data from an excel file, with data in multiple columns. i have written a script but when i comes to the third row of data, i suddenly jumps back to the second row and then it just keeps on going between third and second row. does anyone have experienced this and how did you solve it, if required i can submit my script so you can see how it looks 


#Rumba

Hi besafe,
I was hoping for a small snippet that isolates the problem. I don't know how your Excel File looks like.
Anyhow, I was not able to replicate your issue. You may want to have a look at my test code.
rowcol.mp4rowcol.mp4


Rumba Script code:

Sub Main
SysHide  "Timer"
Dim lRow                                                             ' Hold the last row that contains Data
Dim lCol
Dim value                                                            ' Hold the last row that contains Data
'*******************************************************************
' Bring up Excel application and open a new Workbook
'*******************************************************************
path = "C:\\tmp\\RowColSample.xlsx"                                    ' Path to Excel file
Set XLApp = CreateObject("Excel.Application")
Set XLBook = XLApp.Workbooks.Open(path)
Set XLSheet = XLBook.Worksheets("Sheet1")
XLSheet.Activate                                                    ' Activate the Worksheet
XLSheet.Application.Visible = True

'Get LastRow and Column

lastRow = XLSheet.UsedRange.Rows.Count
lastCol = XLSheet.Range("A1").CurrentRegion.Columns.Count
' Loop through all Columns

For r = 1 To lastRow

For c = 1 To lastCol
value = XLApp.Cells(r, c).Value
EMSendKey value
EMSendKey  " "
Next c
Next r

End Sub