Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Set Xvalues to an array of date, but the x-scale not correct

Tom, thanks for suggestion (using CLng).
yes, your sub-routine shows a curve with x-scale like this:
p1----p2----p3----p4


however, what i want the x-scale is, like this:
p1---p2-------p3---------------p4

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Set Xvalues to an array of date, but the x-scale not correct

To the best of my knowledge, that isn't supported. (although you claimed
you achieved what you want manually)

Perhaps you want to use a logarithmic scale.

--
Regards,
Tom Ogilvy


Alan Pong <no_spam_please wrote in message
...
Tom, thanks for suggestion (using CLng).
yes, your sub-routine shows a curve with x-scale like this:
p1----p2----p3----p4


however, what i want the x-scale is, like this:
p1---p2-------p3---------------p4

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Set Xvalues to an array of date, but the x-scale not correct

Tom, i get it by using Range:

A B
1 date price
2 2003/12/05 0.93
3 2008/09/03 3.26
4 2013/09/02 4.35
5 2033/08/28 5.21

Sub test()

Dim r As Range

Set r = Range("a2:a5")

'if the cells need change later.
'r.Item(1, 1) = CDate("2003/12/5")
'r.Item(2, 1) = CDate("2008/9/3")
'r.Item(3, 1) = CDate("2013/9/2")
'r.Item(4, 1) = CDate("2033/8/28")


ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1).XValues = r
ActiveSheet.ChartObjects(1).Chart.Axes(xlCategory, xlPrimary). _
TickLabels.NumberFormat = "mm/dd/yy"
b = Array(0.93, 3.26, 4.35, 5.21)
ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1).Values = b

End Sub

--END

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date(Year,Month,Day) not returnign correct date jlclyde Excel Discussion (Misc queries) 8 October 16th 09 02:42 PM
Clipart will not scale with array of cells chuck New Users to Excel 0 June 6th 09 05:19 AM
Array formula correct but end up with 0 for answer Heather Excel Discussion (Misc queries) 5 July 30th 07 03:19 AM
date scale problem Mary Walker Excel Discussion (Misc queries) 6 August 13th 06 10:08 PM
Set Xvalues to an array of date, but the x-scale not correct Alan Pong Excel Programming 2 September 8th 03 07:02 AM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"