Hello Dear friends.
I have a macro which brings data from an external application using a loop.
Think that external application has two olumns which is vehicle, and vehicle delivery date. My excel has the same two columns. So it brings vehicle delivery date information from the external application matching the vehicle numbers with external application. When I run the macro, it starts from the beginning until to last row with vehicle number in Excel, no matter if the vehicles have already vehicle delivery date, So it rewrites.
What I want my Macro to consider only the vehicle which does not have vehicle delivery date, which means blank cell in vehicle delivery date column. So that it will skip the vehicles with delivery date. Therefore it will be not working in every update from the beginning rewriting again.
I am using the following code block currently. As I said it working directly from the beginning. What kind of change should I do to make it work as I explained?
for i= 2 To Range ("A2").End(xIdown). Row x 'starts loop from second row from cell A2
vehicleno = i
screen.putstring vehicleno 2, 70 'put the vehicleno from excel to application and press enter
screen.SendKeys ("<enter>")
vehicledeliverydate = screen.getstring(15,19,56) 'for vehicle delivery date info is taken from external application
datenblatt.Cells(i,2).Value = vehicledeliverydate ' past the deliverydate info which is taken from external application to excel from B2
Next i
Columns("a:z").EntireColumn.Autofit
MsgBox ("Datenabfrage beendet!")
End Sub
Thanks in advance for help
I have a macro which brings data from an external application using a loop.
Think that external application has two olumns which is vehicle, and vehicle delivery date. My excel has the same two columns. So it brings vehicle delivery date information from the external application matching the vehicle numbers with external application. When I run the macro, it starts from the beginning until to last row with vehicle number in Excel, no matter if the vehicles have already vehicle delivery date, So it rewrites.
What I want my Macro to consider only the vehicle which does not have vehicle delivery date, which means blank cell in vehicle delivery date column. So that it will skip the vehicles with delivery date. Therefore it will be not working in every update from the beginning rewriting again.
I am using the following code block currently. As I said it working directly from the beginning. What kind of change should I do to make it work as I explained?
for i= 2 To Range ("A2").End(xIdown). Row x 'starts loop from second row from cell A2
vehicleno = i
screen.putstring vehicleno 2, 70 'put the vehicleno from excel to application and press enter
screen.SendKeys ("<enter>")
vehicledeliverydate = screen.getstring(15,19,56) 'for vehicle delivery date info is taken from external application
datenblatt.Cells(i,2).Value = vehicledeliverydate ' past the deliverydate info which is taken from external application to excel from B2
Next i
Columns("a:z").EntireColumn.Autofit
MsgBox ("Datenabfrage beendet!")
End Sub
Thanks in advance for help