how to get the Y Axis to cross at "Today's Date" i

cathyo

New Member
Joined
Jan 19, 2003
Messages
48
I'm sorry - I'm under a time constraint and didn't spend much time searching for an answer...thus, I could use help as soon as possible.

I'm creating a chart where the X axis are dates, everyday -- past 3 weeks months as well as the next 3 weeks. The data plotted to the left of "today" is actual data, whereas the data plotted to the right is estimated data.

I create a vertical line on the graph to indicate where "today" is (double click on X axis, format axis window appears, go to scale index and change the date in the "Value (Y) axis crosses at"

I added a button with a macro assigned to it that will refresh the data and update the chart -- I recorded a macro that changes the date but the code shows "09/28/2006" in the code and I'd like to change the code so it's enters today's date. Can anyone help? Thank You!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Jon Peltier

MrExcel MVP
Joined
May 14, 2003
Messages
5,258
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Code:
    With ActiveChart.Axes(xlCategory)
        .CrossesAt = Now
    End With
 

Forum statistics

Threads
1,175,946
Messages
5,900,478
Members
434,833
Latest member
lulubalisa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top