Click here to Skip to main content
15,904,297 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Is there a general way to check a string... Pin
Dave Kreskowiak28-May-04 7:44
mveDave Kreskowiak28-May-04 7:44 
GeneralRe: Is there a general way to check a string... Pin
viettho28-May-04 8:36
viettho28-May-04 8:36 
GeneralRe: Is there a general way to check a string... Pin
Dave Kreskowiak28-May-04 9:12
mveDave Kreskowiak28-May-04 9:12 
GeneralVBA/Excel - Chart options Pin
Jon G28-May-04 7:19
Jon G28-May-04 7:19 
GeneralRe: VBA/Excel - Chart options Pin
Dave Kreskowiak28-May-04 7:37
mveDave Kreskowiak28-May-04 7:37 
GeneralRe: VBA/Excel - Chart options Pin
Jon G28-May-04 8:09
Jon G28-May-04 8:09 
GeneralRe: VBA/Excel - Chart options Pin
amit2530-May-04 23:11
amit2530-May-04 23:11 
GeneralRe: VBA/Excel - Chart options Pin
Jon G31-May-04 2:31
Jon G31-May-04 2:31 
Okay, here you go:
------------------------------------------------------
'***Create a new series for the chart object<br />
Function createSeries()<br />
    <br />
    Dim DataSource As Range<br />
    Dim DataRows As Long<br />
    Dim DataCols As Integer<br />
    Dim MyNewSrs As series<br />
    Dim valArray() As Double<br />
    Dim currentChart As String<br />
    Dim i As Integer<br />
    Dim chartName As String<br />
    Dim rowNumber As String<br />
    Dim offsetval As Integer<br />
    Dim modValue As Integer<br />
    Dim tempRows As Integer<br />
    <br />
    If tempRow = 6 Then<br />
        modValue = 6<br />
    ElseIf tempRow = 5 Then<br />
        modValue = 5<br />
    Else<br />
        Exit Function<br />
    End If<br />
    <br />
    offsetval = 0<br />
    i = 0<br />
    <br />
    Worksheets("Standards").Select<br />
    <br />
    'Get selection<br />
    Set DataSource = Selection<br />
    With DataSource<br />
        DataRows = .rows.Count<br />
        tempRows = DataRows<br />
        DataCols = .Columns.Count<br />
    End With<br />
    <br />
    ReDim valArray(0 To DataRows - 1)<br />
<br />
    'save values in an array<br />
    While DataRows <> 0<br />
        If Len(DataSource(i + 1)) > 2 Then<br />
            valArray(i - offsetval) = DataSource(i + 1) / standardValues((i - offsetval) Mod modValue)<br />
        Else<br />
            offsetval = offsetval + 1<br />
        End If<br />
        i = i + 1<br />
        DataRows = DataRows - 1<br />
    Wend<br />
    <br />
    i = 0<br />
    DataRows = tempRows<br />
   <br />
    'check values to see if they are in range for the chart<br />
    While DataRows <> 0<br />
        If valArray(i) > 1.2 Then<br />
            valArray(i) = 1.2<br />
        ElseIf valArray(i) < 0.8 Then<br />
            valArray(i) = 0.8<br />
        End If<br />
        <br />
        i = i + 1<br />
        DataRows = DataRows - 1<br />
    Wend<br />
    <br />
    Worksheets("Charts").Select<br />
    myChart.Select<br />
        <br />
    chartName = DataSource.Column<br />
    chartName = ConvertColumnNumberToLetter(chartName)<br />
    <br />
    rowNumber = DataSource.Row<br />
        <br />
    'plot values on the graph<br />
    With ActiveChart.SeriesCollection.NewSeries<br />
        .Name = (Worksheets("Standards").Range(chartName & "2"))<br />
        .Values = valArray<br />
        .XValues = Array(0, 1, 2, 3, 4, 5)<br />
    End With<br />
<br />
    'Format chart to make it look nice<br />
    myChart.Activate<br />
    ActiveChart.ChartType = xlXYScatter<br />
    <br />
    <br />
    ActiveChart.PlotArea.Select<br />
    With Selection.Border<br />
        .ColorIndex = 16<br />
        .Weight = xlThin<br />
        .LineStyle = xlContinuous<br />
    End With<br />
    With Selection.Interior<br />
        .ColorIndex = 2<br />
        .PatternColorIndex = 1<br />
        .Pattern = xlSolid<br />
    End With<br />
    ActiveChart.ChartArea.Select<br />
    With ActiveChart.Axes(xlCategory)<br />
        .HasMajorGridlines = True<br />
        .HasMinorGridlines = False<br />
    End With<br />
    With ActiveChart.Axes(xlValue)<br />
        .HasMajorGridlines = True<br />
        .HasMinorGridlines = False<br />
    End With<br />
    ActiveChart.HasLegend = False<br />
    ActiveChart.Axes(xlValue).Select<br />
    With ActiveChart.Axes(xlValue)<br />
        .MinimumScale = 0.8<br />
        .MaximumScale = 1.2<br />
        .MinorUnitIsAuto = True<br />
        .MajorUnitIsAuto = True<br />
        .Crosses = xlAutomatic<br />
        .ReversePlotOrder = False<br />
        .ScaleType = xlLinear<br />
        .DisplayUnit = xlNone<br />
    End With<br />
    Selection.TickLabels.NumberFormat = "0%"<br />
    ActiveChart.Axes(xlValue).MajorGridlines.Select<br />
    ActiveChart.PlotArea.Select<br />
    ActiveChart.Axes(xlCategory).Select<br />
    ActiveChart.Axes(xlValue).Select<br />
    With ActiveChart.Axes(xlValue)<br />
        .MinimumScale = 0.8<br />
        .MaximumScale = 1.2<br />
        .MinorUnitIsAuto = True<br />
        .MajorUnitIsAuto = True<br />
        .Crosses = xlCustom<br />
        .CrossesAt = 1<br />
        .ReversePlotOrder = False<br />
        .ScaleType = xlLinear<br />
        .DisplayUnit = xlNone<br />
    End With<br />
    ActiveChart.Axes(xlCategory).Select<br />
    With ActiveChart.Axes(xlCategory)<br />
        .MinorUnitIsAuto = True<br />
        .MajorUnit = 1<br />
        .MaximumScale = 5<br />
        .MinimumScale = 0<br />
        .Crosses = xlAutomatic<br />
        .ReversePlotOrder = False<br />
        .ScaleType = xlLinear<br />
        .DisplayUnit = xlNone<br />
    End With<br />
    Selection.TickLabels.AutoScaleFont = True<br />
    With Selection.TickLabels.Font<br />
        .Name = "Arial"<br />
        .FontStyle = "Regular"<br />
        .Size = 1<br />
        .Strikethrough = False<br />
        .Superscript = False<br />
        .Subscript = False<br />
        .OutlineFont = False<br />
        .Shadow = False<br />
        .Underline = xlUnderlineStyleNone<br />
        .ColorIndex = xlAutomatic<br />
        .Background = xlAutomatic<br />
    End With<br />
    ActiveChart.SeriesCollection(1).Select<br />
    With Selection.Border<br />
        .Weight = xlHairline<br />
        .LineStyle = xlNone<br />
    End With<br />
    With Selection<br />
        .MarkerBackgroundColorIndex = 3<br />
        .MarkerForegroundColorIndex = 9<br />
        .MarkerStyle = xlSquare<br />
        .Smooth = False<br />
        .MarkerSize = 4<br />
        .Shadow = False<br />
    End With<br />
<br />
End Function

Generalfile size... Pin
Night_Soul28-May-04 5:10
Night_Soul28-May-04 5:10 
GeneralRe: file size... Pin
Dave Kreskowiak28-May-04 5:55
mveDave Kreskowiak28-May-04 5:55 
GeneralRe: file size... Pin
Night_Soul30-May-04 21:02
Night_Soul30-May-04 21:02 
GeneralRe: file size... Pin
Dave Kreskowiak31-May-04 0:51
mveDave Kreskowiak31-May-04 0:51 
GeneralRe: file size... Pin
Night_Soul31-May-04 2:33
Night_Soul31-May-04 2:33 
GeneralRe: file size... Pin
Serge Lobko-Lobanovsky31-May-04 23:27
Serge Lobko-Lobanovsky31-May-04 23:27 
GeneralRe: file size... Pin
Anonymous7-Jun-04 2:08
Anonymous7-Jun-04 2:08 
GeneralDisable ESC key... Pin
cyberstrategist28-May-04 3:00
cyberstrategist28-May-04 3:00 
GeneralRe: Disable ESC key... Pin
Dave Kreskowiak28-May-04 3:15
mveDave Kreskowiak28-May-04 3:15 
GeneralRe: Disable ESC key... Pin
Night_Soul28-May-04 5:16
Night_Soul28-May-04 5:16 
GeneralRe: Disable ESC key... Pin
Dave Kreskowiak28-May-04 5:44
mveDave Kreskowiak28-May-04 5:44 
GeneralRe: Disable ESC key... Pin
Night_Soul30-May-04 20:45
Night_Soul30-May-04 20:45 
GeneralGetObject Issues Pin
Carlos Mariano28-May-04 1:32
Carlos Mariano28-May-04 1:32 
GeneralRe: GetObject Issues Pin
Dave Kreskowiak28-May-04 3:11
mveDave Kreskowiak28-May-04 3:11 
GeneralRe: GetObject Issues Pin
Carlos Mariano2-Jun-04 23:12
Carlos Mariano2-Jun-04 23:12 
GeneralRe: GetObject Issues Pin
Dave Kreskowiak3-Jun-04 1:24
mveDave Kreskowiak3-Jun-04 1:24 
GeneralRe: GetObject Issues Pin
Carlos Mariano3-Jun-04 5:51
Carlos Mariano3-Jun-04 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.