+ Reply to Thread
Results 1 to 5 of 5

How to draw a conditional graph in excel using vba?

  1. #1
    Registered User
    Join Date
    08-04-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    41

    How to draw a conditional graph in excel using vba?

    Hello!

    I need a help to draw a conditional graph in excel using vba.

    Excel Worksheet1: Statement Tool,
    SheetName: Merchant: Creating a tool. In this I am entering the TID No and taking data from 3 different sheets based on the TID No and final calculation is showing on this.

    Excel Worksheet2: Net Earnings Log
    SheetName: Net Earnings : Displayed with TID No and Monthly earnings as in the sheet.

    I have completed till the calculation part.

    Now I want as per the TID No. the last 12 months data should be selected and the graph should display on sheet Merchant.

    Kindly help on this.

    Thanks a lot in advance.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-04-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    41

    Re: How to draw a conditional graph in excel using vba?

    Can anyone help me on the above issue?

    Kindly help me.

  3. #3
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: How to draw a conditional graph in excel using vba?

    Sorry, I can't help with your information... it would help if you add more data (fake info, of course) and sample results that you want to see...

    Post again for everyone to see.
    Last edited by djapigo; 04-01-2015 at 03:24 PM.

  4. #4
    Registered User
    Join Date
    08-04-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    41

    Re: How to draw a conditional graph in excel using vba?

    Hello!

    I want to go and search the TID no in Net Earning Log sheet.

    When the TID no match, I want to create the graph for the last 12 months rather we copy and paste in Statement Tool or not.

    Just want a graph to be displayed in sheet named with Merchant.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: How to draw a conditional graph in excel using vba?

    I want to go and search the TID no in Net Earning Log sheet.
    In a divide and conquer sense, I would probably start by focusing on this step.

    Usually when I want to "search" a list/range/database, I will use the MATCH() function. https://support.office.com/en-us/art...9-533f4a37673a

    The MATCH() function is accessible to VBA: http://www.cpearson.com/excel/Callin...ionsInVBA.aspx

    The MATCH() function will tell you which row contains the TID no. Then you can use the INDEX() function (in Excel) or the Cells(i,j) method in VBA to extract the desired data from that row.

    I might use the MATCH() function again on the "dates" row to tell me which row corresponds to the current month, then count backwards 12 cells/months from that to get the values for the most recent 12 months.

    An alternative approach might be to use Filters. The help file for the Range object in VBA (https://msdn.microsoft.com/en-us/lib...ice.15%29.aspx ) has sample code provided by Dennis Wallentin that uses the Advanced Filter method to extract data from one list and paste into a range in another sheet.

    Once you have the data extracted from the source database, creating the chart should be straightforward.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can excel draw a graph in real time ?
    By semajjames in forum Excel General
    Replies: 9
    Last Post: 01-31-2015, 11:42 AM
  2. draw circle in graph
    By paascal in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-23-2013, 06:49 AM
  3. How to draw static vertical lines in Excel graph
    By vivekengg in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-03-2011, 10:04 AM
  4. Excel 2007 : Draw a certain graph in excel
    By hus2020 in forum Excel General
    Replies: 4
    Last Post: 08-15-2009, 10:00 AM
  5. VBA to draw a graph
    By adam405 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2008, 08:16 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1