Returns a Range object that represents the cell at the end of the region that contains the specified source range. Using this property is equivalent to pressing the CTRL+UP ARROW, CTRL+DOWN ARROW, CTRL+LEFT ARROW, or CTRL+RIGHT ARROW key combinations.
expression.End(Direction)
expression Required. An expression that returns a Range object.
Direction Required XlDirection . The direction in which to move.
XlDirection can be one of these XlDirection constants. |
xlDown |
xlToLeft |
xlToRight |
xlUp |
End property as it applies to the ChSegment object.
Returns a ChSegmentBoundary object that represents the end of a segment boundary on a format map.
expression.End
expression Required. An expression that returns a ChSegment object.
Remarks
Use the Value property of the returned ChSegmentBoundary object to set the ending value for the specified segment of the format map. Use the Interior, Line, and Border properties to format the segment boundary.
Example
As it applies to the Range object.
This example selects a range of cells starting at the active cell, moving down in direction until a blank cell is reached.
Sub SelectContiguousCells()
Dim ssConstants
Dim rngStartCell
Set ssConstants = Spreadsheet1.Constants
Set rngStartCell = Spreadsheet1.ActiveCell
Spreadsheet1.ActiveSheet.Range(rngStartCell, _
rngStartCell.End(ssConstants.xlDown)).Select
End Sub
As it applies to the ChSegment object.
This example binds Chartspace1 to the Order Details table in the SQL Server Northwind database. Then a format map is created that highlights the bottom 10% of the values in red and the top 20% of values in green.
Sub Window_Onload()
Dim serseries1
Dim segBottom10Pct
Dim segTop20Pct
Dim chConstants
Set chConstants = ChartSpace1.Constants
' The following two lines of code bind Chartspace1 to the Order Details table in the
' Northwind SQL Server database.
ChartSpace1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=TRUE;" & _
"Integrated Security=SSPI;Initial Catalog=Northwind;" & _
"Data Source=DataServer;"
ChartSpace1.DataMember = "Order Details"
' The following two lines of code bind Chartspace1 to the Quantity and ProductID fields
' in the Order details table.
ChartSpace1.SetData chConstants.chDimCategories, chConstants.chDataBound, "ProductID"
ChartSpace1.SetData chConstants.chDimValues, chConstants.chDataBound, "Quantity"
' Create a format map.
ChartSpace1.SetData chConstants.chDimFormatValues, chConstants.chDataBound, "Quantity"
' Set a variable to the first series in the first chart in Chartspace1.
Set serseries1 = ChartSpace1.Charts(0).SeriesCollection(0)
' Add a segment to the format map. This segment will
' represent the bottom 10% of values in the chart.
Set segBottom10Pct = serseries1.FormatMap.Segments.Add
' Measure the segment boundaries based upon a percentage.
segBottom10Pct.Begin.ValueType = chConstants.chBoundaryValuePercent
segBottom10Pct.End.ValueType = chConstants.chBoundaryValuePercent
' Set the beginning value to 0%, and the ending value to 10%.
segBottom10Pct.Begin.Value = 0
segBottom10Pct.End.Value = 0.1
' Format the interior of the matching values.
segBottom10Pct.Begin.Interior.Color = "red"
segBottom10Pct.End.Interior.Color = "red"
' Add a segment to the format map. This segment will
' represent the top 20% of values in the chart.
Set segTop20Pct = serseries1.FormatMap.Segments.Add
' Measure the segment boundaries based upon a percentage.
segTop20Pct.Begin.ValueType = chConstants.chBoundaryValuePercent
segTop20Pct.End.ValueType = chConstants.chBoundaryValuePercent
' Set the beginning value to 80%, and the ending value to 100%.
segTop20Pct.Begin.Value = 0.8
segTop20Pct.End.Value = 1
' Format the interior of the matching values.
segTop20Pct.Begin.Interior.Color = "green"
segTop20Pct.End.Interior.Color = "green"
End Sub