How to Combine two columns in another excel

hello guys,
i have one excel Combine.xlsx (9.3 KB)
which contains column like “C” and cloumn “D” i want to combine these two and print the output like in sheet2 in another excel.

output is like
1
2
3
4
5
54
5
57
input u can take from Combine.xlsx file

Hi @sayli,

I don’t understand your question completely, but as per my understanding, If you want to print column D values under column E in another sheet, first paste the column C values in new sheet and then read the range (assume RowCount) of new sheet. Then copy values from column D, paste values mentioning the range as

                "A" + RowCount.tostring

Hi @sayli,
Please check this one: Combine.zip (17.6 KB)
Someone already asks me about this one.
So what I did here was I looped through the rows of sheet1.
Then i will check if the value of a cell is null or empty.
If not, I will add a row in a data table.
Then after, I will append he data table to sheet2.
Hope this helps :slight_smile:
Despi

5 Likes

so this is something i just tried
open excel application scope
read range to datatable DT
for each row in DT
assign To: row(“New Column”) Value: row(“D”).ToString + row(“C”).ToString
Write Range DT

D C New Column
1 1
2 2
3 3
4 4
5 5
54 54
5 5
57 57
Main.xaml (7.4 KB)
1 Like

Your solution is better than mine … learned something new from you today @Jan_Brian_Despi :smiley:

2 Likes

Good to hear that! :slight_smile:

2 Likes

thanks

1 Like

If I gave you the right answer, please mark my answer as the solution by ticking check to close this topic and help others as well :slight_smile:

2 Likes

Thanks VirajN

1 Like

Welcome @sayli

hey if i want to add one column next to “New Column” like column “flag” and in that want to differentiate like which data coming from which Column “C” or “D” like
flag
C
C
C
D
C
C
D
C

if you check @Jan_Brian_Despi workflow it checks for the null value. Maybe you can tweak it to identify the non null value in the row and assign the appropriate column header as the flag

ohkz

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.