I want to merge and center the Rows for which value is same after adding rows in excel what can I Do?
So basically these data is coming from the data table no I have to merge the rows which have same value
Not yet , I have to merge those cell whose value is same
In that solution it is assign the “cells to merge” but I don’t have that kind of data I am not aware which cell I have to merge , I have extracted data with scrapping ,adding data rows with the Filteration at the end I want to merge and center only those rows whose data is same .
That completes the question now
Please follow below steps
- Read the data into datatable(dt)
- Use Sort datatable to first get all the similar values together(Step 2 and 3 are to be performed only if data is not already sorted)
- Now paste the data back
- From the datatable delete the third column and use Remove duplicates(This will give all unique values of row 1 and 2 together)
- Now loop through datatable and use find/replace excel activity(with search on Currentrow(2).Tostring) which gives you the cell numbers.
- Take the first and last cell numbers and pass it to the code I gave
- For getting first column cells replace B with A and you have the first and last cell again for first column as well
cheers
Not working