on 05-15-2014 5:48 PM
Hi everyone!
I am trying to create a script to create a sales order (t-code VA01) with multiple line items.
My script code is using counter i to go down each row in excel to pull in the data (for each sales order),
but to create each line item within each sales order, i need it to read across a few columns so that i can make multiple line items.
Any ideas?
Hi Christina,
here's a little Example:
For Example there are 4 Rows to navigate through:
For i = 1 to 100 'only for example
debug.Print xlssht.Cells(i,1).Value '<- that is Cell "A1"
debug.Print xlssht.Cells(i,2).Value 'Cell "B1"
debug.Print xlssht.Cells(i,3).Value '... and so on ...
debug.print xlssht.Cells(i,4).value
next i
So if the first Loop is through you will enter the next Column 2
Using the Cell property of Excel is much faster as the "Range" property...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Christina,
as far as I understand your problem correct, I think you need a loop in a loop.
Look at these example:
For i = 1 To RowCount
'First code here to fill your fields
For j = 1 To ColumnCount
'Second code here to make your multiple line items
Next j
Next i
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using vbscript
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.