How to delete columns in a collection

junjie

Member
VJ ~
i have tried again add more row (columns ), and noticed it only deleted the column whichever i put in the last row.
the rests still remain :(
 

VJR

Well-Known Member
VJ ~
i have tried again add more row (columns ), and noticed it only deleted the column whichever i put in the last row.
the rests still remain :(
Is the looping correct? Share your screenshots of the diagram, and properties of every stage.
 

junjie

Member
hi VJ
sorry for late reply. busy with loads of work :(
below is the details. appreciate your help !
1528797917050.png

first I open the excel file and get it as collection (name Original file) which contains all columns.
i also created a collection which contains those columns i want to delete.
then, i start loop, the loops property showed in previous chat.
not sure why only the last row is deleted ... ?
 

VJR

Well-Known Member
Check the column names correctly in the 'Columns Unwanted' and in the original Collection. Check spellings, spaces, any new line character, etc.
 

VJR

Well-Known Member
Hi junjie, I've checked this and it works perfectly fine if done as explained above. Make sure to give the same name as the Original Collection in the Output collection of Delete Columns action.
 

junjie

Member
oh oh : )
thanks for your kind checking ...
i will look at the names again to ensure no space no spelling errors
but not sure i try i add another columns to delete, and it seems it only pick up the last row (columns) ??
just a bit weird ...
 

junjie

Member
hi VJ
could you help this ... I'm now stuck :(
i want to Level column and its value, also add column Grade and its data as well, into the other sheet (insert them in column E and F), and the data of this 2 columns need to follow the vlookup (which means need to be matching with the Staff ID.

1528862298153.png

1528862321650.png

Please help advise steps ? and what to be written in the property ...
 

junjie

Member
hi VJ
i go through your guides and refer to the link.
i still cannot understand why source workbook and destination workbook is the same workbook ???

1528967761727.png

while the Workbook Name data created here is the workbook we open to copy the data. Now the property in the image shows using the same workbook ?? (which i understand this workbook Name is the source workbook)

so , pls advise ?
 

junjie

Member
hi VJ
good news :)
I've made it through ... haha
results :
1528986801555.png

but can you help me , how to copy the header Level also to the column E ???

thanks so much :)
 

junjie

Member
Hi VJ
next step, i need to resolve the checking requirements as below:
1528988818460.png

given that i have another data of Level in column C.
after I have copied the data Level in column E from another table, now i need to validate the consistency of this 2 columns.
in column G, if data in column C = data in column E, it's a Yes (correct) , and vice versa, it's a No (wrong)
how should i do :
1. add the header checking
2. compare (validate as said above) ?
 

VJR

Well-Known Member
hi VJ
good news :)
I've made it through ... haha
results :
View attachment 1042

but can you help me , how to copy the header Level also to the column E ???

thanks so much :)
Did you see, you asked about a problem but if you gave it a little more time and effort you were able to resolve it yourself. Now need to do a little bit more. There is something clearly visible in the Copy Paste action where you need to make a change in order to get the 'Level' header for Column F.
After the Copy Paste action, give it a different name like 'NewLevel' or 'Level 1' using a simple 'Set Cell Value' action so that you can use it later for comparing the columns other wise it will be two same columns with same name (more on it below).


Regarding comparing each row in Column C with Column F,
- Once you get the 'Level1' header right, get the worksheet data into a Collection using 'Get Worksheet As Collection' action of Ms Excel VBO
- Loop through this collection
- Inside the loop use a Decision stage and check [CollectionName.Level]=[CollectionName.Level1]
There are two arrow flows out of the Decision stage Yes and No. Point the Yes to a Calc stage where you will set the 'Checking' column to Yes. You will do this by writing "Yes" in the Calc stage and in the Store In section of Calc stage [CollectionName.Checking].
Do the same for the 'No' arrow by writing a "No".
- After the loop is over, write the collection back to the Excel using 'Write Collection' action. This will write your collection back to the sheet with the 'Checking' column filled up.
- Save the Excel.
 

junjie

Member
Hi VJ
i will try the ways doing via collection as you guided above :)
ah yes, thanks for guiding how to save collection into excel :)

the way i do below via VBO still cannot get through ... because after i add header , then it cannot continue count all rows ...
1529035069627.png
 

VJR

Well-Known Member
Hi junjie,

What are your trying to achieve by counting the rows. In the steps I have provided there are no counting of rows.
Refer the instructions accurately. I have provided the exact names of Actions of the Ms Excel VBO and which stage to use where.
 

junjie

Member
hi VJ,
you know what error is this ?
i cannot open the file ... :(

file name, path ...all correct, but why not found in instance ... ?

1529046699607.png
 
Top