Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 18
Default VBA for setting max value in scroll bars on charts?

I have 20 dynamic charts with scroll bars and I want to avoid manually
adjusting the maximum value each month on the 20 scroll bars.

Is there some VBA I could use to do this?

Thank you!

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1,071
Default VBA for setting max value in scroll bars on charts?

Don't know if it will work in this case, but a good place to start is with
the macro recorder.

Turn it on (Tools | Macro Record new macro...), do whatever it is you want
to do to one scrollbar by hand, turn off the recorder, and switch to the
VBE. Did XL generate the necessary code? If you are using the controls
from the Forms toolbar, it did. If from the Control Toolbox, it probably
didn't.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article .com, Bob@
1800-mail.com says...
I have 20 dynamic charts with scroll bars and I want to avoid manually
adjusting the maximum value each month on the 20 scroll bars.

Is there some VBA I could use to do this?

Thank you!


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 18
Default VBA for setting max value in scroll bars on charts?

Thank you, that worked. Although there is probably a more elegant way
to write this with a loop, here's what I came up with below.

Also, thank you for your great web site.


Sheets("6").Select
ActiveChart.Shapes("Scroll Bar 6").Select
With Selection
.Max = .Value + 1
End With
Sheets("7").Select
ActiveChart.Shapes("Scroll Bar 5").Select
With Selection
.Max = .Value + 1
End With
End Sub


Tushar Mehta wrote:
Don't know if it will work in this case, but a good place to start is with
the macro recorder.

Turn it on (Tools | Macro Record new macro...), do whatever it is you want
to do to one scrollbar by hand, turn off the recorder, and switch to the
VBE. Did XL generate the necessary code? If you are using the controls
from the Forms toolbar, it did. If from the Control Toolbox, it probably
didn't.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article .com, Bob@
1800-mail.com says...
I have 20 dynamic charts with scroll bars and I want to avoid manually
adjusting the maximum value each month on the 20 scroll bars.

Is there some VBA I could use to do this?

Thank you!



  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 18
Default VBA for setting max value in scroll bars on charts?

I ran into another problem where the scroll bars on various charts seem
to be using the same names and I need them to use unique names - I
can't have two "number 5" for example - is there any way to control the
names assigned to the scroll bars?


wrote:
Thank you, that worked. Although there is probably a more elegant way
to write this with a loop, here's what I came up with below.

Also, thank you for your great web site.


Sheets("6").Select
ActiveChart.Shapes("Scroll Bar 6").Select
With Selection
.Max = .Value + 1
End With
Sheets("7").Select
ActiveChart.Shapes("Scroll Bar 5").Select
With Selection
.Max = .Value + 1
End With
End Sub


Tushar Mehta wrote:
Don't know if it will work in this case, but a good place to start is with
the macro recorder.

Turn it on (Tools | Macro Record new macro...), do whatever it is you want
to do to one scrollbar by hand, turn off the recorder, and switch to the
VBE. Did XL generate the necessary code? If you are using the controls
from the Forms toolbar, it did. If from the Control Toolbox, it probably
didn't.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article .com, Bob@
1800-mail.com says...
I have 20 dynamic charts with scroll bars and I want to avoid manually
adjusting the maximum value each month on the 20 scroll bars.

Is there some VBA I could use to do this?

Thank you!



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
excel scroll bars within work books PK Excel Worksheet Functions 0 January 23rd 06 02:20 PM
How do I set a maximum value for the scroll bars in Excel? PipsPerson Excel Discussion (Misc queries) 2 November 10th 05 04:32 PM
Remove Scroll Bars, etc on First Sheet Only Ray Lloyd Excel Discussion (Misc queries) 1 September 21st 05 04:33 PM
of Named Ranges, Dynamic Charts and scroll bars... z.entropic Charts and Charting in Excel 2 May 20th 05 07:16 PM
Excel opens saved workbook without tabs or scroll bars showing? Dave W Franklin Excel Worksheet Functions 1 May 11th 05 11:11 PM


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