Hello.
I have a worksheet that will contain data in sheet A . Column A. Range can be anywhere from A2:A1000
Trying to figure out how to load 50 rows of data at a time, then send to the software (url) that I am using, etc..
The Process currently works but only up until 50 rows of data as that's a limitation of the software itself.
So basically there are 3 steps, load data from excel, upload data to an external url, and get data from an external url.
I am using row count to get the number of rows of data.
I need to loop the process to go from cell A2 (since A1 is the header info) and go down until the end of the data (if less than 50 lines).
If more than 50 lines, stop ... perform the load and retrieve piece (that is currently working with the load file) then repeat as needed (another 50 rows of data) until the last row. So if data is 120 lines, I need to do 3 loads (50, next 50, then the remaining 20)
Current code and thoughts'get row count
X =WorksheetFunction.CountA(Sheets("A").Range("A2:A1000"))
'STEP 1 - create load file to send to external URLWhile i <= x
I have a worksheet that will contain data in sheet A . Column A. Range can be anywhere from A2:A1000
Trying to figure out how to load 50 rows of data at a time, then send to the software (url) that I am using, etc..
The Process currently works but only up until 50 rows of data as that's a limitation of the software itself.
So basically there are 3 steps, load data from excel, upload data to an external url, and get data from an external url.
I am using row count to get the number of rows of data.
I need to loop the process to go from cell A2 (since A1 is the header info) and go down until the end of the data (if less than 50 lines).
If more than 50 lines, stop ... perform the load and retrieve piece (that is currently working with the load file) then repeat as needed (another 50 rows of data) until the last row. So if data is 120 lines, I need to do 3 loads (50, next 50, then the remaining 20)
Current code and thoughts'get row count
X =WorksheetFunction.CountA(Sheets("A").Range("A2:A1000"))
'STEP 1 - create load file to send to external URLWhile i <= x
Set rng =Sheets("A").Range("A2:A1000")
myitem("field1") = cell.Value
myitem("field2") = cell.Offset(0,2).Value
myitem("field3") = cell.Offset(0, 3).Value
myitem("field4") = cell.Offset(0, 4).Value
(fields 1 -4 will remain the same throughout the file)
i = 0
For Each cell In rng
myitem("field5") = cell.Offset(0, 1).Value
(field 5 is the only one that has different data in it - this is the field that needs to loop until it gets to the end of the data or 50 lines of data . whichever comes first.... if greater than 50 .... grab 50 rows at a time...loop...etc...)
items.Add myitem
Set myitem = Nothing
Set subitem = Nothing
i = i + 1
Next
'Step2 - (send portion of the macro is working)
'Step 3 - (retrieve portion of the macro is working)
Not sure if I have to clear the load file once steps 1-2-3 are complete for 50 rows of data
myitem("field1") = cell.Value
myitem("field2") = cell.Offset(0,2).Value
myitem("field3") = cell.Offset(0, 3).Value
myitem("field4") = cell.Offset(0, 4).Value
(fields 1 -4 will remain the same throughout the file)
i = 0
For Each cell In rng
myitem("field5") = cell.Offset(0, 1).Value
(field 5 is the only one that has different data in it - this is the field that needs to loop until it gets to the end of the data or 50 lines of data . whichever comes first.... if greater than 50 .... grab 50 rows at a time...loop...etc...)
items.Add myitem
Set myitem = Nothing
Set subitem = Nothing
i = i + 1
Next
'Step2 - (send portion of the macro is working)
'Step 3 - (retrieve portion of the macro is working)
Not sure if I have to clear the load file once steps 1-2-3 are complete for 50 rows of data