ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   More elaboration on help pages (https://www.excelbanter.com/excel-programming/428428-more-elaboration-help-pages.html)

[email protected]

More elaboration on help pages
 
I just reviewed the example in the Help for ReplaceFormat. Then I
went to the Help for Replace method as applied to a Range object.
From that description, I would never have guessed that providing empty
strings for the What and Replacement "variants" would yield the effect
implied by the ReplaceFormat example. For example, I thought that the
ReplaceFormat would only affect replacement text.

Are there more comprehensive help pages (possibly on the web) on these
classes that elaborate on the terse descriptions in the Help? As a
newbie to VBA, and from experience in other environments, I intend to
rely quite a bit on accurate, comprehensive, and well organized
documentation to figure out how to code. VBA's help seems well
organized, but actual descriptive text seems quite terse and
incomplete. Is there some kind of definitive standard that one could
resort to in order to suss out the subtleties of meaning (which often
aren't very subtle in their coding implications)?

Thanks.

Patrick Molloy[_2_]

More elaboration on help pages
 
the Help looks perfectly fine to me -- i see no empty strings. Can you
clarify your problem please?

from Help:

Sets the replacement criteria to use in replacing cell formats.

expression.ReplaceFormat

expression Required. An expression that returns one of the objects in the
Applies To list.

Example
The following example sets the search criteria to find cells containing
Arial, Regular, Size 10 font, replaces their formats with Arial, Bold, Size 8
font, and then notifies the user.

Sub MakeBold()

' Establish search criteria.
With Application.FindFormat.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
End With

' Establish replacement criteria.
With Application.ReplaceFormat.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 8
End With

' Notify user.
With Application.ReplaceFormat.Font
MsgBox .Name & "-" & .FontStyle & "-" & .Size & _
" font is what the search criteria will replace cell formats
with."
End With

End Sub


" wrote:

I just reviewed the example in the Help for ReplaceFormat. Then I
went to the Help for Replace method as applied to a Range object.
From that description, I would never have guessed that providing empty
strings for the What and Replacement "variants" would yield the effect
implied by the ReplaceFormat example. For example, I thought that the
ReplaceFormat would only affect replacement text.

Are there more comprehensive help pages (possibly on the web) on these
classes that elaborate on the terse descriptions in the Help? As a
newbie to VBA, and from experience in other environments, I intend to
rely quite a bit on accurate, comprehensive, and well organized
documentation to figure out how to code. VBA's help seems well
organized, but actual descriptive text seems quite terse and
incomplete. Is there some kind of definitive standard that one could
resort to in order to suss out the subtleties of meaning (which often
aren't very subtle in their coding implications)?

Thanks.


JLGWhiz[_2_]

More elaboration on help pages
 
The Replace Method is for replacing cell values and strings. The
ReplaceFormat method is for just that, replacing formats. VBA is an object
oriented langauge. The objects are modified by their properties.
John Walkenbach has a good book for beginners, available through Amazon.Com,
titled Excel VBA Programming for Dummies which sells at a reasonable price.
It explains a lot of these type issues in detail.


wrote in message
...
I just reviewed the example in the Help for ReplaceFormat. Then I
went to the Help for Replace method as applied to a Range object.
From that description, I would never have guessed that providing empty
strings for the What and Replacement "variants" would yield the effect
implied by the ReplaceFormat example. For example, I thought that the
ReplaceFormat would only affect replacement text.

Are there more comprehensive help pages (possibly on the web) on these
classes that elaborate on the terse descriptions in the Help? As a
newbie to VBA, and from experience in other environments, I intend to
rely quite a bit on accurate, comprehensive, and well organized
documentation to figure out how to code. VBA's help seems well
organized, but actual descriptive text seems quite terse and
incomplete. Is there some kind of definitive standard that one could
resort to in order to suss out the subtleties of meaning (which often
aren't very subtle in their coding implications)?

Thanks.




[email protected]

More elaboration on help pages
 
The actual code in question follows the code that you pasted...here is
the remainder of the example:

' Make the replacements in the worksheet.
Cells.Replace What:="", Replacement:="", _
SearchFormat:=True, ReplaceFormat:=True

Again, this was provided just as an example. I was wondering if there
were help pages online that elaborate more (in general).

Thanks.

[email protected]

More elaboration on help pages
 
I'm relatively comfortable with OOP, though in C++/STL/matlab. The
example to which I'm referring is in ReplaceFormat help page, but
makes use of Replace. It's the example implies things about how
Replace works with null strings in What and Replacement which is not
apparent from the Replace help page.


All times are GMT +1. The time now is 03:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com