[Solved] Merge macro or formula for same contents
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
[Solved] Merge macro or formula for same contents
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.
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.
- Attachments
-
- merge.ods
- (11.51 KiB) Downloaded 222 times
Last edited by Hagar Delest on Mon Sep 04, 2017 10:11 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.1.2 windows vista
-
- Posts: 145
- Joined: Mon Jun 13, 2016 10:50 am
Re: Merge macro or formula for same contents
Hello,
Here's an example:
Regards.
Here's an example:
Code: Select all
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
- Attachments
-
- chandrankrishnan.ods
- (14.84 KiB) Downloaded 247 times
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
Re: Merge macro or formula for same contents
Hi hubert lambert ,
Thanks for the program its working fine.you saved my time and i trying this for past one week.
(can you please teach us to make simple macro program like this)
Thanks a ton. Have a Good day.
Thanks for the program its working fine.you saved my time and i trying this for past one week.
(can you please teach us to make simple macro program like this)
Thanks a ton. Have a Good day.
OpenOffice 4.1.2 windows vista
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
Re: Merge macro or formula for same contents
Hi
Can you please me to fine tune the program.i.e after sum result the serial number has to be generate as as same as total qty(i.e is in merged condition like 1,2,3 etc)
and then column "K" and "L" to be deleted.
Thanks in advance.
Can you please me to fine tune the program.i.e after sum result the serial number has to be generate as as same as total qty(i.e is in merged condition like 1,2,3 etc)
and then column "K" and "L" to be deleted.
Thanks in advance.
OpenOffice 4.1.2 windows vista
-
- Posts: 145
- Joined: Mon Jun 13, 2016 10:50 am
Re: Merge macro or formula for same contents
At your service...
- Attachments
-
- chandrankrishnan.ods
- (14.97 KiB) Downloaded 200 times
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
Re: Merge macro or formula for same contents
Hi
Good day to you.Program work fine,but one thing
after total qty sum(in merged form) i need continuous serial number to be generate(as mentioned in column I(marked in red color) like 1,2,3...
Thanks in advance.
Good day to you.Program work fine,but one thing
after total qty sum(in merged form) i need continuous serial number to be generate(as mentioned in column I(marked in red color) like 1,2,3...
Thanks in advance.
- Attachments
-
- chandrankrishnan(2).ods
- (14.36 KiB) Downloaded 217 times
OpenOffice 4.1.2 windows vista
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
Re: Merge macro or formula for same contents
Hi,
i tried once again with macro program,where its working for continuous serial for 2cell merge,whereas for 3cell merge, continuous serial number is collapsing that is its missing some numbers.
Can any one help me in this regards.
I had attached my entire work sheet with macro program.
Thanks in advance.
i tried once again with macro program,where its working for continuous serial for 2cell merge,whereas for 3cell merge, continuous serial number is collapsing that is its missing some numbers.
Can any one help me in this regards.
I had attached my entire work sheet with macro program.
Thanks in advance.
- Attachments
-
- SFO COMBINE MAC.ods
- (24.29 KiB) Downloaded 216 times
OpenOffice 4.1.2 windows vista
-
- Posts: 145
- Joined: Mon Jun 13, 2016 10:50 am
Re: Merge macro or formula for same contents
Here it is:
AOOo 4.1.2 on Win7 | LibreOffice on various Linux systems
- chandrankrishnan
- Posts: 63
- Joined: Sat Mar 05, 2016 1:21 pm
Re: Merge macro or formula for same contents
Hi hubert lambert ,
Thanks a ton.Its working fine and perfect.
Thankyou.
Thanks a ton.Its working fine and perfect.
Thankyou.
OpenOffice 4.1.2 windows vista