Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VErify .Characters propertiey

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
I was trying to find a way of copying a cell's value and strikethrough. However, when only part of the text is strikethrough then it gets trickier. So i wrote this in order to just spot the characters that are "strikethrough-ed".
If anyone knows of a better way to copy only the strikethrough, and not other formmating, i'd appreciate your thoughts....Thanks!!

With ActiveCell
For i = 1 To .Characters.Count
If .Characters(i, 1).Font.Strikethrough = True Then MsgBox .Characters(i, 1).Text
Next
End With
 
Luis939,

What if there are multiple strike-thru sequences?
[tt]
Now is the time span measured in hours, minutes and seconds for all good men humans of any gender to come to the aid of their country!
[/tt]


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
well I figure i would first make the value of the target cell equal to the value of the activecell, then simply make the ith character of both cells match strikethroughs
 
Code:
[SourceRange].Copy [PasteRange]
With [PasteRange]
  For i = 1 To .Characters.Count
    If [SourceRange].Characters(i, 1).Font.Strikethrough Then
      .Characters(i, 1).Font.Strikethrough = True
    End If
  Next
End With
This assumes that SourceRange is a single cell.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Nice, I didnt know that you could use a 'PasteRange' in that manner. I'll see how it works out for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top