PDA

View Full Version : Studying VBA for Excel and getting frustrated by objects/properties...



ajjava
03-25-2019, 05:58 PM
I just found two ways to accomplish the same task (change the color of a data series in a chart), and I'm glad.

HOWEVER

How does one know what the correct objects/properties are to use, when intellisense doesn't engage and when MS Help doesn't offer any suggestions? Isn't there some sort of reference that lists objects and then all the potential properties that can be set/changed?

For instance, to accomplish my above goal with the data series, both of these worked:

.SeriesCollection(1).Format.Fill.Forecolor.RGB = RGB(155,155,155)
.SeriesCollection(1).Interior.Color = RGB(155,155,155)

Do you know how many combinations of various properties I had tried, before finding those two ways? Surely, there's an easier way. Yes? Please?

大灰狼1976
03-25-2019, 07:27 PM
Hi ajjava!
Different chart types have different processing methods.
Some methods are universal.
Please refer to the attachment.
It is more convenient to record macros and modify them later.

ajjava
03-26-2019, 03:37 AM
Hi ajjava!
Different chart types have different processing methods.
Some methods are universal.
Please refer to the attachment.
It is more convenient to record macros and modify them later.


Hi and thanks for the info. But I was more interested in finding a way to know/see all the properties related to an object, so that I wouldn't have to basically guess and hope to hit upon a correct combo of syntax. The available tools seem ambiguous to me, at best. Is it just a matter of memorizing code snippets over time?