Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Feb 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing values in a chart (Excel 2003)

    Below I have code that will print a chart based on the line number of the planner to print. I also need to put in an input box to allow the person who is printing the planners chart to be able to enter a dollar amount, and have Excel calculate the dollor amount with the dollar amount the planner has already, and show the increase or decrease on the chart. Can anyone please show me how to do this?

    Range("start").Value = Application.InputBox(prompt:="Enter line number of planner to print?", Default:="?", Title:="Get Planner Number")
    Range("start").Value = Range("start").Value - 9
    Application.Calculate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    Range("A1").Select

    Thanks,
    Chris

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing values in a chart (Excel 2003)

    Welcome to Woody's Lounge!

    It's hard to know what you need without seeing the chart. If you wish, you can post a (stripped down, anonymized and if necessary zipped) copy of your workbook.

  3. #3
    Lounger
    Join Date
    Feb 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing values in a chart (Excel 2003)

    Thanks Hans. I tried zipping the file, but it's too big. It's a 119k file. In my original post, I forgot to get the chart setup code. It's below with the code I originally posted underneath it.

    With ActiveSheet.PageSetup
    .PrintTitleRows = ""
    .PrintTitleColumns = ""
    ActiveSheet.PageSetup.PrintArea = "Print_chart"
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.38)
    .RightMargin = Application.InchesToPoints(0)
    .TopMargin = Application.InchesToPoints(0.25)
    .BottomMargin = Application.InchesToPoints(0.35)
    .HeaderMargin = Application.InchesToPoints(0)
    .FooterMargin = Application.InchesToPoints(0)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlPortrait
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With

    Range("start").Value = Application.InputBox(prompt:="Enter line number of planner to print?", Default:="?", Title:="Get Planner Number")
    Range("start").Value = Range("start").Value - 9
    Application.Calculate
    ActiveWindow.SelectedSheets.PrintPreview 'PrintOut copies:=1
    Range("A1").Select

    Thanks for your help.
    Chris

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing values in a chart (Excel 2003)

    I'm sorry, that doesn't help. The extra code you posted sets the page setup, it has nothing to do with the chart.

  5. #5
    Lounger
    Join Date
    Feb 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing values in a chart (Excel 2003)

    I found the report. It's enclosed. I had to copy it to a new worksheet because I couldn't show the data on rest of the spreadsheet.

    Thank you for your help.

    Thanks,
    Chris

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing values in a chart (Excel 2003)

    Thanks, but I'm lost. I don't understand what your original question has to do with this workbook. There is no named range "Start", and I don't see what you would want to do with an amount entered by the user.

    If you want us to help you, please help us by providing clear and sufficient information.

Posting Permissions

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