Bar Chart (Urgent!)

Hi everyone, so I have a bar chart that is date (x-axis) by hours (y-axis), and for each date there are two bars (based on data from Column C and Column D). So I want to make it so that the chart automatically updates everytime I enter a new set of data for column C and D, and everytime the new set of bars appear in the chart they have values on top of them. So if I have 5 set of data (C1:C5, and D1:D5), only C5 and D5 bars have values on them. And if there is C6 and D6 then the values on C5 and D5 bars will disappear and instead the C6 and D6 bars will have values on them in the chart. Finally if the value for any bar is 0, then no value will be shown on that bar. Any insight on how to make macro for this? Thanks a ton!
Victor LiSenior Risk AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dustin SaundersDirector of OperationsCommented:
You don't need anything special to accomplish that, if you format your columns as a Table then your chart will automatically expand as you add values into that table.
0
Mike in ITIT System AdministratorCommented:
If this doesn't work attach a sample of your workbook for us to take a look at.
0
Dustin SaundersDirector of OperationsCommented:
So, as mentioned you don't need to use VBA to do this-- it's built in to the charts.  Is there some reason you have to use VBA?

Start with my data and convert it into a table.
excelChart1.png
Next I'm going to create a 2-D Column chart.
excelChart2.png
Then, select the data for the chart.
excelChart3.png
I select the full range of my table.
excelChart4.png
Now, with the Chart selected, I go to Design > Add Chart Element > Data Labels > Outside End
excelChart5.png
With the Data Labels added, I select each set and right click > Format Data Labels
excelChart6.png
In the property window on the right, I drop down 'Number' and in Format Code enter #"" then click Add.
excelChart7.png
Now I have the chart with data labels on top, and with the formatting I entered any 0 values will not appear.  Any new rows I enter in to the table will be added to the Chart automatically.
excelChart10.png
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Victor LiSenior Risk AnalystAuthor Commented:
Thanks for the response Dustin! Yes the reason I want to use macro is because I want only the last two bars of the chart to display value on top, and if a new set of data is entered, then only the new dataset bar will have value and the previous ones will disappear. Does that make sense?
0
TracyVBA DeveloperCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Dustin Saunders (https:#a42453293)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

broomee9
Experts-Exchange Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.