View Single Post
  #10   Report Post  
David McRitchie
 
Posts: n/a
Default

The real question is does the macro work for you or not, and
can you modify it to do what you want. I think it certainly meets
what you asked for in your question -- you don't need the parts
about capitalization.

The WITH is used as a prefix to statements within it's scope
that begin with a period -- they will be prefixed with the WITH part.
They started from recorded macros with a lot of material being removed,
but if there were several statements within the WITH it is supposed to be
faster, it can make lines fit better without wrapping as well in other cases.

With cell.Font
.FontStyle = "Bold"
End With


is equivalent to
cell.Font.FontStyle = "Bold"

Look in your VBE Help and look for "characters property"

expression.Characters(Start, Length)

you can code the parameters or you can use Start= Length=
so that you don't have to know the order that the parameters are in.

also look up "range property" in your VBE help, specifically the topic:
Range Property (Application, Range, or Worksheet Object)

There is no need to use cells(Rptr, Cptr) relative to the entire
worksheet, when you can work with a range and within that
range work one cell at a time -- that one cell is a range that was
named "cell" in the loop. The range of all of the cells to be
looked at need not even be contiguous. If you look at the entire
page that you were first referred to, you would see that some
ranges are comprised on only the intersection of a selection
and the text cells -- meaning each cell looked at must be in the
used range or other selection and must be a text cell.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Eric"
Ok, here's snippet from your page, let me ask you some things:
cell.Formula = UCase(cell.Formula)
With cell.Font
.FontStyle = "Bold"
End With
With cell.Characters(Start:=i + 1).Font
.FontStyle = "Regular"
End With

why:
With cell.Font
.FontStyle = "Bold"
End With
is
Cells(R, C).Font.Bold = True
the same thing? Whats "With"? i dont get it, doesnt make sense to me.

is
With cell.Characters(Start:=i + 1).Font
.FontStyle = "Regular"
End With
the same as
Cells(R,C).Characters(<whats this parameter here?).Font.FontStyle="Bold"
or
Cells(R,C).Characters(0,5).Font.FontStyle="Bold" ' bold first 5 chars of
cell?
Thanks,
Eric