Set RangeofChard = Union(Range(Cells(ChardRowStart, 1), Cells(ChardRow
+End, 1)), _
Range(Cells(ChardRowStart, UsedCol), Cells(Ch
+ardRowEnd, UsedCol)), _
Range(Cells(ChardRowStart, MaintCol), Cells(C
+hardRowEnd, MaintCol)), _
Range(Cells(ChardRowStart, OtherUsedCol), Cel
+ls(ChardRowEnd, OtherUsedCol)))
This had created a Range for a chart, the range looked like this: "A2:A4,B2:B4, E2:E4 ..."
Now Ive tried to convert it to perl code: but there are always Errorcodes, the problem is, that i cannot simply put it into an string because the Column indixes are numeric like 1,2,3... but for the range they must be converted to "A,B,C..." but I dont know how to make this?
If i simply try this for example:
my $Range = $currentsheet->Union($currentsheet->Range($currentsheet->C
+ells($HeaderRow, 1), $currentsheet->Cells($ToIndex, 1)),
$currentsheet->Range($currentsheet->Cells($He
+aderRow, $UsedCol), $currentsheet->Cells($ToIndex, $UsedCol)),
$currentsheet->Range($currentsheet->Cells($He
+aderRow, $MaintCol), $currentsheet->Cells($ToIndex, $MaintCol)),
$currentsheet->Range($currentsheet->Cells($He
+aderRow, $OtherUsedCol), $currentsheet->Cells($ToIndex, $OtherUsedCol
+)));
print "$Range\n";
Then Range is empty...
I think this will be the last problem, because ist is at the end of my macro...
Thanks for help
UPDATE: I dont know why but all my line breaks are gone
Edited by Chady -- fixed formatting, added code tags. |