G
Greg Maxey
That is my 64 million dollar question today.
Some of you may know that I am working on a macro to report table and cell data. Fruit of my labor so far is
http://gregmaxey.mvps.org/Table_Cell_Data.htm
Take the situation where you create a 5x2 table and merge B2 and C2
Then select A1,B1,C1,A2,B2.
If you run TableCellHelper from Macros8.Dot, it will report the selected range as A1:B2. While that may appear correct on the screen {=sum(A1:B2)} will return will not correctly sum the value of the selected cells.
For that reason, I have elected to exclude selection range reporting if the table contains split or merged cells:
If Selection.Tables(1).Uniform Then
Report span
Else
Don't report span
End If
That seems a huge concession. For example if I have a 20x50 table and merge S50 and T50, I have effectively deep sixed range reports for the remaining million or so selection possibilities :-(
Now I am thinking maybe I should just report the range with the disclaimer that if the table is not uniform then the reported range may be in doubt.
After a working lifetime of dedication to trying got put ordnance on target, that seems cheesy ;-)
So, can anyone help me answer the question (in VBA lingo):
If Selected range of cells is free of split or merged cells that would booger up a range report
Report span
Else
Don't report span
End If
As always thanks for your time.
Some of you may know that I am working on a macro to report table and cell data. Fruit of my labor so far is
http://gregmaxey.mvps.org/Table_Cell_Data.htm
Take the situation where you create a 5x2 table and merge B2 and C2
Then select A1,B1,C1,A2,B2.
If you run TableCellHelper from Macros8.Dot, it will report the selected range as A1:B2. While that may appear correct on the screen {=sum(A1:B2)} will return will not correctly sum the value of the selected cells.
For that reason, I have elected to exclude selection range reporting if the table contains split or merged cells:
If Selection.Tables(1).Uniform Then
Report span
Else
Don't report span
End If
That seems a huge concession. For example if I have a 20x50 table and merge S50 and T50, I have effectively deep sixed range reports for the remaining million or so selection possibilities :-(
Now I am thinking maybe I should just report the range with the disclaimer that if the table is not uniform then the reported range may be in doubt.
After a working lifetime of dedication to trying got put ordnance on target, that seems cheesy ;-)
So, can anyone help me answer the question (in VBA lingo):
If Selected range of cells is free of split or merged cells that would booger up a range report
Report span
Else
Don't report span
End If
As always thanks for your time.