Consulting

Results 1 to 4 of 4

Thread: VBA: Macro for multiple charts creation with predefined settings

  1. #1

    VBA: Macro for multiple charts creation with predefined settings

    Hi,

    I'm new here, so hello everybody!

    I've been struggling with a problem in my work since last year. The problem seems not to be so hard to solve as far as I keep an idea and algorithm in my mind. So here's what exactly I'm trying to achieve:

    1. Data is stored in a sheet in following format:

    vbatest1.xlsx

    2. I expect from VBA macro to do a following thing:

    Generate as many separate charts with a single sensor as number of sensors stored in data sheet. I have over 300 sensors which means over 300 columns. I'd like to make it automated. Sometimes I'll need change number of sensors (columns) when a new sensor will appear in data sheet.

    Speaking about a chart it should be simple XY graph with a title = sensor 1, next title = sensor 2, etc.

    I make a macro which generates simple but proper chart, but I did a manual thing to automate it - just have copied macro in a module changing chart range - but I feel it's stupid.

    Regards,
    M.

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Would the attached do?
    No macro but a dynamic range adjusted by the scroll bar beneath the chart.
    Later you could add another scroll bar or two to add perhaps 1 or two more plots on the same chart for comparison of any sensors you want.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    It didn't solve my problem. I need separate charts up to number of sensors generated automatically based on data sheet (btw. charts named the same as sensors). An example below:
    Attached Files Attached Files

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    try the attached.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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