Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Alternative to integer?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keri - 15 Dec 2006 13:14 GMT
Hi,

I have this code which sets the max scale on a chart. If i type into to
the scale in the format axis box a number such as 0.013808 then my
chart scale updates. However if "p7" (as referred to in the code has a
value of 0.013808 my macro does strange things with my chart. (The
scale goes crazy and the x axis meets at the top of the chart etc).

The only obvious reason for this is that I am defining maxy as an
integer, which from my small knowledge I seem to remember has to be a
whole number. What is the alternative if I want to define it as a
number with up to 8 decimal places?

Dim maxy as integer
maxy = activesheet.range("p7")

ActiveSheet.ChartObjects("Chart 32").Activate
   ActiveChart.Axes(xlValue).Select
   With ActiveChart.Axes(xlValue)
       .MinimumScale = 0.0004
       .MaximumScale = maxy
       .MinorUnitIsAuto = True
       .MajorUnitIsAuto = True
       .Crosses = xlAutomatic

Many thanks.
Bob Phillips - 15 Dec 2006 13:47 GMT
Define it as Double.

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> Hi,
>
[quoted text clipped - 22 lines]
>
> Many thanks.
keri - 15 Dec 2006 14:13 GMT
Bob,

All posts have been excellent and very helpful, my thanks to everyone
who has given their time to getting me this far! I have learnt so much
and eventually will get my head around this!

I will go back and rate all posts now.

Many thanks to everyone for all of their help again.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.