Merging cells

I have this excel


Col A is the input format
Col B is the output which i need through UiPath
is there any activity to do this ? or do i need to write a VB code for the same

1 Like

@Pogboom

check the reference

1 Like

Hi @Pogboom


PreviousValue = ""
For Each row in dtInput
    CurrentValue = row("ColA").ToString
    If CurrentValue = PreviousValue Then
        row("ColB") = PreviousValue & " " & CurrentValue
    Else
        row("ColB") = CurrentValue
    End If
    PreviousValue = CurrentValue
End For Each
1 Like

getting error as remove unused imports

1 Like

is this the vb code??

1 Like

@Pogboom

No use readrange workbook and store it in a dt var and then follow

1 Like

not working exception thrown col B should be the output which i want through bot

1 Like

@Pogboom

refer this

forumquestion.zip (10.9 KB)

1 Like

dt2 is not declared in this where is dt2 coming from ? reading forum excel file?

1 Like

@Pogboom

You can try this

forumupdatedcode.zip (11.7 KB)

1 Like

not working where have you declared dt2?
can you share the output file image?

1 Like

@Pogboom
Sorry my mistake

in the write range output file you need to disable the option add headers

1 Like

finaloutput is coming as empty sheet. can you please validate again

1 Like

@Pogboom

can you change the input file path in the read range activity and try once

1 Like

what if i want to rewrite it in that first column only basically overwriting?

1 Like

@Pogboom

if you want to write it in the first column before to the write range activity use assign activity

And in the place of filepath use the input file path

1 Like

@Pogboom

If you find solution with mine,Please do mark mine as solution to close the loop

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