title: Excel VBA - Adjust Color Line and X-Axis Interval
body: <p>I used Excel VBA to create a chart and I want to adjust the line color and x-axis interval.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>Sub add_cpu_chart(server_hostname, site)
      On Error Resume Next
  
      Dim rpt_site As String
      rpt_site = site
  
      Set tbl = ThisWorkbook.Sheets(server_hostname).ListObjects(1)
      strTableName = tbl.Name
      strTableRange = tbl.Range.Address
  
      Dim m_s_name, m_e_name As Date
  
      m_s_name = CDate(fromDateStr)
      m_e_name = CDate(toDateStr)
  
      'Create new embedded chart
      Set shp = ThisWorkbook.Sheets(server_hostname).Shapes.AddChart
  
      'Position Shape over range
  
      shp.Top = 100
      shp.Left = 200
  
      With shp
          With .Chart
              'Specify source data and orientation
              '.SetSourceData Source:=ActiveSheets.Range(Table1 &amp; "[#All]"), _
              'PlotBy:=xlRows
              .SetSourceData Source:=ThisWorkbook.Sheets(server_hostname).Range(strTableName &amp; "[#All]")
              .ChartType = xlLineMarkers
              .SetElement (msoElementChartTitleAboveChart)
              .HasTitle = True
              .ChartTitle.Text = "CPU Utilization of " &amp; server_hostname &amp; " in " &amp; _
              rpt_site &amp; " (" &amp; Format(m_s_name, "dd-Mmm") &amp; " to " &amp; Format(m_e_name, "dd-Mmm yyyy") &amp; ")"
              .ChartTitle.Font.Size = 14
              '.ChartArea.Font.Size = 14
              .Legend.Delete
  
              .SetElement (msoElementPrimaryValueAxisTitleRotated)
              .Axes(xlValue, xlPrimary).AxisTitle.Text = "CPU Utlization (%)"
              .Axes(xlValue, xlPrimary).AxisTitle.Font.Size = 10
              .Axes(xlValue).MinimumScale = 0
              .Axes(xlValue).MinorUnit = 2
              .Axes(xlValue).MaximumScale = 100
              .Axes(xlValue).MajorUnit = 20
              .Axes(xlValue).TickLabels.NumberFormat = "General"
  
              .SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
              .Axes(xlCategory, xlPrimary).AxisTitle.Text = "Date of the Month"
              .Axes(xlCategory, xlPrimary).AxisTitle.Font.Size = 10
              '.Axes(xlCategory).MajorUnit = 1
              .Axes(xlCategory).TickLabels.NumberFormat = "d"
              With .PlotArea.Format.Fill
                  .Visible = msoTrue
                  .ForeColor.ObjectThemeColor = msoThemeColorBackground1
                  .ForeColor.TintAndShade = 0
                  .ForeColor.Brightness = -0.150000006
                  .Transparency = 0
                  .Solid
              End With
          End With
      End With
  End Sub
  </code></pre>
  
  <p>I want to change the line color to red - as in excel 2003 - as well as change the data in interval separated by 2 days. Currently, the data is in the form <code>1,2,3,4...</code> I want to display the data in the form <code>1,3 ,5...</code>.</p>