Results 1 to 3 of 3

Thread: Excelmacroquestion Pleease! Urgent!

  1. #1

    Thread Starter
    Hyperactive Member Libero's Avatar
    Join Date
    Jun 2000
    Location
    Swedish viking
    Posts
    460

    Unhappy

    This Macrocode is not working.

    Sub Macro1()

    Set myrange = Application.InputBox("Markera celler."; Type:=8)


    Xvalue = Application.InputBox("Ange titel för X-Axel.")
    Yvalue = Application.InputBox("Ange titel för Y-Axel.")
    DTitle = Application.InputBox("Ange namn för diagrammet.")
    Range(myrange).Select ' Here is the problem

    Application.CutCopyMode = False
    Charts.Add
    ActiveChart.ChartWizard Source:=Sheets("Sheet1").Range( _
    myrange); Gallery:=xlLine; Format:=2; PlotBy:= _
    xlColumns; CategoryLabels:=1; SeriesLabels:=2; HasLegend:=1; _
    Title:=DTitle; CategoryTitle:=Yvalue; ValueTitle:=Xvalue; _
    ExtraTitle:=""
    End Sub


    Pleease help me with this....

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178

    Cool Only referenced the object (Not any of its properties) !!

    You are using the range object but none of its properties.....

    Try using this instead

    Code:
    Sub Macro1() 
    
    Set myrange = Application.InputBox("Markera celler."; Type:=8) 
    
    Xvalue = Application.InputBox("Ange titel för X-Axel.") 
    Yvalue = Application.InputBox("Ange titel för Y-Axel.") 
    DTitle = Application.InputBox("Ange namn för diagrammet.") 
    Range(myrange.addresslocal).Select ' Here is the problem 
    
    Application.CutCopyMode = False 
    Charts.Add 
    ActiveChart.ChartWizard Source:=Sheets("Sheet1").Range( _ 
    myrange); Gallery:=xlLine; Format:=2; PlotBy:= _ 
    xlColumns; CategoryLabels:=1; SeriesLabels:=2; HasLegend:=1; _ 
    Title:=DTitle; CategoryTitle:=Yvalue; ValueTitle:=Xvalue; _ 
    ExtraTitle:="" 
    End Sub
    Hope this helps
    Steve

  3. #3

    Thread Starter
    Hyperactive Member Libero's Avatar
    Join Date
    Jun 2000
    Location
    Swedish viking
    Posts
    460
    Tank u VERY much!! Worked perfect. :-))

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