PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, June 27, 2022

[FIXED] How to graph a specified range with VBScript

 June 27, 2022     excel, graph, vbscript     No comments   

Issue

I have an excel sheet with 5 columns in it. I want to use a VBScript to graph data only from columns A, D, and E.

Currently, using the code below, I am getting all 5 columns graphed. Please advise and thanks in advance.

With .ActiveChart
 .SetSourceData(Source:=objXLSWorkSheet.Range("A:A" & LastRowofA, "D:D" & LastRowOfD, "E:E" & LastRowOfE))
End With

Solution

Try to use Union method to create the necessary range:

With .ActiveChart
    .SetSourceData .Application.Union(objXLSWorkSheet.Range("A1:A" & LastRowofA), objXLSWorkSheet.Range("D1:D" & LastRowOfD), objXLSWorkSheet.Range("E1:E" & LastRowOfE))
End With


Answered By - omegastripes
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing