Consulting

Results 1 to 4 of 4

Thread: Characters

  1. #1
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location

    Characters

    If one wants to "manage" individual characters within the text of a cell, they can be referenced something like:

    With TargetCell.Characters(Start:=1, Length:=6)
    .Font = something
    etc
    End With
    According to the object browser, another valid approach is:

    Start = 1
    Length = 6
    With TargetCell.Characters(Start, Length)
    etc
    End With
    The first method works, but the 2nd method generates errors; in particular

    Run Time Error 438
    Object does not support this property or method
    So, what am I doing wrong?

    Thanks
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    In your second example, try adding ".Font" afterwards. You must have a property, and Character is not a property (per se).

  3. #3
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Indeed, that should work fine if you use a valid method, like .Font.Size = 14
    K :-)

  4. #4
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by Killian
    Indeed, that should work fine if you use a valid method, like .Font.Size = 14
    Thanks to both of you; the problem had nothing to do with Start or Length -- just stupidity on my part
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •