D
Dennis
I took the below example from Jon Peltier's site at http://peltiertech.com/
I have a worksheet with 26 columns and 95 rows. The first row consists of labels
and all other rows are numbers. When I highlight any three columns that are not
next to each other I get iDataRowsCt=65536 and iDataColsCt=1.
When I highlight 4 column that are next to each other I get iDataRowsCt=65536
and iDataColsCt=4.
Why is the number of rows=65536 and not equal to 95?
Why is he number of columns=1 when the selected columns are not next to each
other?
==========From http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html
======================================================================
Sub MultiX_OneY_Chart()
Dim rngDataSource As Range
Dim iDataRowsCt As Long
Dim iDataColsCt As Integer
Dim iSrsIx As Integer
Dim chtChart As Chart
Dim srsNew As Series
If Not TypeName(Selection) = "Range" Then
'' Doesn't work if no range is selected
MsgBox "Please select a data range and try again.", _
vbExclamation, "No Range Selected"
Else
Set rngDataSource = Selection
With rngDataSource
iDataRowsCt = .Rows.Count
iDataColsCt = .Columns.Count
MsgBox "idataRowsCt=" & iDataRowsCt & " iDataColsCt=" & iDataColsCt
End With
I have a worksheet with 26 columns and 95 rows. The first row consists of labels
and all other rows are numbers. When I highlight any three columns that are not
next to each other I get iDataRowsCt=65536 and iDataColsCt=1.
When I highlight 4 column that are next to each other I get iDataRowsCt=65536
and iDataColsCt=4.
Why is the number of rows=65536 and not equal to 95?
Why is he number of columns=1 when the selected columns are not next to each
other?
==========From http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html
======================================================================
Sub MultiX_OneY_Chart()
Dim rngDataSource As Range
Dim iDataRowsCt As Long
Dim iDataColsCt As Integer
Dim iSrsIx As Integer
Dim chtChart As Chart
Dim srsNew As Series
If Not TypeName(Selection) = "Range" Then
'' Doesn't work if no range is selected
MsgBox "Please select a data range and try again.", _
vbExclamation, "No Range Selected"
Else
Set rngDataSource = Selection
With rngDataSource
iDataRowsCt = .Rows.Count
iDataColsCt = .Columns.Count
MsgBox "idataRowsCt=" & iDataRowsCt & " iDataColsCt=" & iDataColsCt
End With