Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 21 Gen, 18:33, "Peter T" <peter_t@discussions wrote:
[..] Q3 The scenario is this: I call FormatAxes from other subroutines, and I want it to work either on the active chart, or on a chart which is not the active one. First of all I'd make an additional procedure purely to return a chart, lets call it GetChart, then pass the chart to the routine that formats the axes. Function FormatAxes() is only then concerned with formatting axes, so you'd remove all arguments other than those pertaining to the axes, but add one, namely an object reference to the chart you are concerned with. The first argument will be say 'cht as Chart' [..] You're right, of course. It occured to me yesterday, after thinking over this thread, that maybe passing just the object reference to FormatAxes would have been better, and I also got the same suggestion from other sources. A good lesson in correct programming style :) I'm not sure why Len would work, from Excel help, "[..] returns a Long containing the number of characters in a string or the number of bytes required to store a variable.", *so it doesn't return a Boolean. Len(myString) returns a Long. It's an effective way to test a string, though not the only way. A number can be coerced to a Boolean to return True (not zero) or False (zero). So - If Len(myString) then * * ' we have a non zero length string Else *' the string is "" End If ' could also be written If Len(myString) = True Then or If Len(myString) 0 then Ok, nice: I use IsMissing to check for Optional arguments, didn't know that Len would work as well for string arguments. Regards, Peter T Thanks for all your support, Best Regards Andrea |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extracting chart title from Embedded Excel Chart in PowerPoint | Excel Programming | |||
Embedded Chart Versus Chart - ShowDetail Issue | Charts and Charting in Excel | |||
enabling chart events for an embedded chart | Excel Programming | |||
what is the difference between embedded chart and chart-in-a-sheet | Excel Programming | |||
Determine if there's data in embedded word document | Excel Programming |