Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Alternative to integer?

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Alternative to integer?

Define it as Double.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"keri" wrote in message
oups.com...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Alternative to integer?

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
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
How do I add an integer to an existing integer? Aaron Excel Worksheet Functions 3 December 17th 09 09:46 PM
integer integer format Excel Worksheet Functions 1 May 3rd 07 06:45 PM
Dim i,j,k As Integer Arne Hegefors Excel Programming 4 August 18th 06 04:49 PM
Get next Integer value Stuart[_5_] Excel Programming 7 February 16th 04 04:48 AM
Not seeing integer Martin Wheeler Excel Programming 1 September 4th 03 03:29 AM


All times are GMT +1. The time now is 01:27 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"