Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vreditel

macrumors newbie
Original poster
Jul 28, 2011
11
0
Hello all!!!
I have a trouble. I have Excel document, which contains some shapes and i needed to get Excel union in next format: "Address of the top left cell of the range which includes the shapes: Address of the right bottom cell of the range which includes the shapes". I have next code for this:
Code:
on GET_FULL_USED_RANGE(wbId, wsId)
	tell app "Microsoft Excel"
		set ws to sheet wsId of workbook wbId
		set ur to used range of ws
		repeat with i from 1 to (count shapes of ws)
			set so to shape i of ws
			set tlc to get address of top left cell of so
			set brc to get address of bottom right cell of so
			set shpRng to range (tlc & ":" & brc) of ws
			set ur to union range1 ur range2 shpRng
		end repeat
		return get address (range (get address ur) of ws)
	end tell
end GET_FULL_USED_RANGE
but it's return a string, which contains list of ranges- for example : "$A$1:$C$7,$C$8:$E$12,$F$4:$G$9,$J$11:$K$15".
 
Ok, thanks all, but now i changed my Java code for this problem and all is ok. My problem is resolved, but I still do not understand how to get range in standart format("A1:E15" for example) for returns union.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.