Hai all,Good day.
can anyone help me for the attached sheet with formula or macro program for two cells have the same contents means then result has been to be in merged format.
Attached file.
thanks in advance.
sub addAndMerge()
doc = thiscomponent
sheet = doc.CurrentController.ActiveSheet
sum = 0
row = 2
first = row
do
range = sheet.getCellRangeByPosition(3, row, 7, row+1)
data = range.DataArray
sum = sum + data(0)(3)
if data(0)(0) <> data(1)(0) then
sheet.getCellByPosition(7, first).setValue(sum)
tobemerged = sheet.getCellRangeByPosition(7, first, 7, row)
tobemerged.merge(True)
sum = 0
first = row + 1
end if
row = row +1
loop until data(1)(0) = ""
end sub
Users browsing this forum: JeJe and 10 guests