Results 1 to 4 of 4

Thread: [RESOLVED] Excel Macro In Vb

Threaded View

  1. #1

    Thread Starter
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Resolved [RESOLVED] Excel Macro In Vb

    CAN ANYONE HELP ME?

    IN THE FOLLWING EXCEL MACRO, I WANT THE MACRO TO CHECK IF THERE IS ALREADY A SHEET BY THE NAME OF "AHTBARCHART" IF THERE IS THEN IT SHOULD DISPLAY A POPUP WINDOW "CHART ALREADY EXISTS" ELSE IT SHOULD GO AHEAD AND CREATE A CHART AS MENTIONED BELOW.


    VB Code:
    1. Sub AHTBARCHART()
    2. '
    3. ' AHTBARCHART Macro
    4. '
    5.  
    6. '
    7.    Range("D3:D13,F3:F13").Select
    8.    Range("F3").Activate
    9.    Charts.Add
    10.    ActiveChart.ChartType = xlColumnClustered
    11.    ActiveChart.SetSourceData
    12. Source:=Sheets("JANUARY").Range("D3:D13,F3:F13"), _
    13.        PlotBy:=xlColumns
    14.    [U]ActiveChart.Location Where:=xlLocationAsNewSheet,
    15. Name:="AHTBARCHART"[/U]
    16.    With ActiveChart
    17.        .HasTitle = True
    18.        .ChartTitle.Characters.Text = "AVERAGE AHT PER TEAM LEADER"
    19.        .Axes(xlCategory, xlPrimary).HasTitle = True
    20.        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "TEAM
    21. LEADER"
    22.        .Axes(xlValue, xlPrimary).HasTitle = True
    23.        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "AVERAGE
    24. AHT"
    25.    End With
    26.    Sheets("JANUARY").Select
    27.    Range("A1").Select
    28.    Sheets("AHTBARCHART").Select
    29. End Sub
    Last edited by Siddharth Rout; Feb 7th, 2006 at 07:54 PM. Reason: RESOLVED

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width