excel


Populate ComboBox with list of charts on sheet


I am tired of formatting axes by hand to zoom in on data in scatter plots, so I am building a userform with axes controls. I want it to be easily reusable for many charts in many worksheets, so I am not intending to store the axes ranges on the sheet. Here's my userform :
.
The text boxes are called YMaxEnter, YminEnter, XminEnter and XMaxEnter.
The comboBox at the top (ComboBox1) should have a list of charts on the current sheet. When I select one, the four text boxes should fill in with the appropriate .Axes(xlValue).MinimumScale, etc.
Private Sub UserForm_Initialize()
Dim thisChart as Chart
For Each thisChart In ActiveWorkbook.Charts
'Nothing happens after the ForEach
ComboBox1.AddItem (thisChart.ChartTitle.Caption)
Next
End Sub
Private Sub ComboBox1_AfterUpdate()
`Some code that gets the Chart object, cht, back from ComboBox1
YMinEnter.Value = cht.Axes(xlValue).MinimumScale
YMaxEnter.Value = cht.Axes(xlValue).MaximumScale
XMinEnter.Value = cht.Axes(xlCategory).MinimumScale
YMaxEnter.Value = cht.Axes(xlCategory).MaximumScale
End Sub
Then I will have routines like this, but with some error checking added.:
Private Sub YMaxEnter_AfterUpdate()
'Again, code to get the chart object, cht, out of ComboBox1.
cht.Axes(xlValue).MaximumScale = MaxEnter.Value
End Sub
My first step isn't working, however - the comboBox initialization loop doesn't do anything. For Each thisChart In ActiveWorkbook.Charts doesn't throw up an error, but it doesn't do fill in any values, and the routine never moves on to the next line (ComboBox1.AddItem (thisChart.ChartTitle.Caption))
I know that I am going to run in to more trouble in the second routine (getting the chart object back from the combobox) but right now I can't even get alist of charts into the combobox.
All suggestions welcome.

Related Links

Hyperlink based on two dynamic cell values
Excel - Determine if value is contain in named range
Writing excel functions in vba
I need to be able to select columns in Excel by specifying column numbers in vba
How to update a specific row of a table in Excel using Microsoft Graph?
columns' values based on specific rows in pivot table excel
VBA Adding cells from one sheet to another by cell
Searchng a sheet for a value and returning row & column numbers
How to take a control of specific cell of XL?
Vlookup exact text on a cell text string
HTTP GET responds with empty body, downloads excel document in IE
VBA replace comma with line break in word?
Excel online sharing
Change cell value based off of selection from ListBox
How to remove hidden quotes
Sorting out data by insert and copy and paste special

Categories

HOME
machine-learning
processing
qt5
java-ee
dll
automation
screensaver
angular-material2
statistics
web-crawler
entities
maven-lifecycle
metal
64bit
virtocommerce
strongswan
servo
memcached
protege
spring-transactions
windows-authentication
treeset
dijkstra
category
conv-neural-network
prestashop-1.6
drupal-modules
ietf-netmod-yang
jquery-gmap3
twincat-ads
accurev
eventtrigger
sprite
cider
phylogeny
frama-c
hibernate-criteria
akka-stream
u2
pywavelets
android-appbarlayout
hal
data-migration
bing-api
wijmo5
povray
jqassistant
jquery-ui-autocomplete
ipc
nexmo
infowindow
gearman
bluehost
package-name
tornado-motor
free-jqgrid
hashcode
asn.1
gunicorn
google-optimize
kernel-module
leanft
data-storage
sphero-api
azure-sql-server
inline
jenkinsfile
singleton-type
imei
getelementsbyclassname
xunit.net
canvas-lms
subtitle
tinyxml2
webrole
c++1z
magicalrecord
android-7.1-nougat
fixed
ms-project-server-2013
orphan
spock-reports
audacity
tablecellrenderer
distinct-on
webots
tess-two
busy-waiting
pull-request
tap
event-loop
geographical-information
resin
sequel
uploadifive
function-prototypes
arbitrary-precision
jml
teamsite
intel-galileo
problem-steps-recorder
android-3.0-honeycomb
nodejitsu
tiles2
gideros
meteor-slides
capability
enctype
phonetics
keymando
system-design
mobile-phones
function-overloading
abpeoplepickerview
visualtreehelper
windows-explorer
tomahawk
vtl

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile