Here is my code i have been given to try and replicate a similar report, i beleive i understand most of it, but there are 2 lines that are giving me trouble. the addline and the color.
i know the addline function needs 4 pionts, but the 4 points in this code are variables, and the data changes every day. from this code does it use the actual data in the cells?
and the color where can i find out what color 10 is or 17? if they defined it somewhere i can't find it? is there something i'm missing?
Dim CMSCALLbeginx As Integer
Dim CMSCALLendx As Integer
Dim CMSCALLbeginy As Integer
Dim CMSCALLendy As Integer
Dim CMSCALLvalue As Integer
Dim CMSCALLcolor As Integer
Sheets("ArrowPositioning".Select
CMSCALLbeginx = ActiveSheet.Cells(6, 3).Value
CMSCALLendx = ActiveSheet.Cells(6, 4).Value
CMSCALLbeginy = ActiveSheet.Cells(6, 5).Value
CMSCALLendy = ActiveSheet.Cells(6, 6).Value
CMSCALLvalue = ActiveSheet.Cells(6, 2).Value
CMSCALLcolor = ActiveSheet.Cells(6, 7).Value
Sheets("DashboardSheet".Select
If CMSCALLvalue < 0.5 Then
Sheet1.Shapes.AddLine(CMSCALLbeginx, CMSCALLendx, CMSCALLbeginy, CMSCALLendy).Select
Selection.ShapeRange.Line.Weight = 1.5
Selection.ShapeRange.Line.ForeColor.SchemeColor = CMSCALLcolor
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
Selection.ShapeRange.Flip msoFlipHorizontal
Selection.ShapeRange.Flip msoFlipVertical
Else
Sheet1.Shapes.AddLine(CMSCALLbeginx, CMSCALLendx, CMSCALLbeginy, CMSCALLendy).Select
Selection.ShapeRange.Line.Weight = 1.5
Selection.ShapeRange.Line.ForeColor.SchemeColor = CMSCALLcolor
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
Selection.ShapeRange.Flip msoFlipVertical
End If
End Sub
i know the addline function needs 4 pionts, but the 4 points in this code are variables, and the data changes every day. from this code does it use the actual data in the cells?
and the color where can i find out what color 10 is or 17? if they defined it somewhere i can't find it? is there something i'm missing?
Dim CMSCALLbeginx As Integer
Dim CMSCALLendx As Integer
Dim CMSCALLbeginy As Integer
Dim CMSCALLendy As Integer
Dim CMSCALLvalue As Integer
Dim CMSCALLcolor As Integer
Sheets("ArrowPositioning".Select
CMSCALLbeginx = ActiveSheet.Cells(6, 3).Value
CMSCALLendx = ActiveSheet.Cells(6, 4).Value
CMSCALLbeginy = ActiveSheet.Cells(6, 5).Value
CMSCALLendy = ActiveSheet.Cells(6, 6).Value
CMSCALLvalue = ActiveSheet.Cells(6, 2).Value
CMSCALLcolor = ActiveSheet.Cells(6, 7).Value
Sheets("DashboardSheet".Select
If CMSCALLvalue < 0.5 Then
Sheet1.Shapes.AddLine(CMSCALLbeginx, CMSCALLendx, CMSCALLbeginy, CMSCALLendy).Select
Selection.ShapeRange.Line.Weight = 1.5
Selection.ShapeRange.Line.ForeColor.SchemeColor = CMSCALLcolor
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
Selection.ShapeRange.Flip msoFlipHorizontal
Selection.ShapeRange.Flip msoFlipVertical
Else
Sheet1.Shapes.AddLine(CMSCALLbeginx, CMSCALLendx, CMSCALLbeginy, CMSCALLendy).Select
Selection.ShapeRange.Line.Weight = 1.5
Selection.ShapeRange.Line.ForeColor.SchemeColor = CMSCALLcolor
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
Selection.ShapeRange.Flip msoFlipVertical
End If
End Sub