PC Review


Reply
Thread Tools Rate Thread

Alternative to integer?

 
 
keri
Guest
Posts: n/a
 
      15th Dec 2006
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.

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      15th Dec 2006
Define it as Double.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"keri" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
keri
Guest
Posts: n/a
 
      15th Dec 2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Adsense Alternative - Commission Junction Alternative -ClickBank Alternative William9999 Windows XP Performance 0 2nd Nov 2010 09:02 AM
Google Adsense Alternative - Commission Junction Alternative -ClickBank Alternative William9999 Windows XP Performance 0 2nd Nov 2010 09:01 AM
'AddressOf' expression cannot be converted to 'Integer' because 'Integer'is not a delegate type. Patrick Dugan Microsoft VB .NET 3 14th Mar 2005 03:12 PM
Can't create Integer field, a Long Integer is created instead? cbu Microsoft Access Database Table Design 1 2nd Jan 2004 04:58 PM
division of variable integer into best fit integer parts Eddy Microsoft Excel Discussion 7 13th Sep 2003 07:59 PM


Features
 

Advertising
 

Newsgroups
 


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