Multiple text format in Excel cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm writing now convertor from my own Report Component to Microsoft Excel
format and have a problem: cannot programmically change font and text format
for PARTS of text in cell. It's easy to do by hand, but how can I do it
programmically?

Please help me! I have to appear checkboxes and comboboxes in Excel sheet,
and decided to do it in following manner:

[x] CheckboxName,
where [x] - symbol with code 0xFD of Wingdings font.

Or, maybe, there are other ideas?

David Avsajanishvili
 
Hi David,

Try the following code which resulted from macro recorder (I have cleaned it
a bit).

Ragards,
KL

Sub Macro2()
ActiveCell = "Text Test"
With ActiveCell
With .Characters(Start:=1, Length:=4).Font
.Size = 10
.ColorIndex = 0
End With
With .Characters(Start:=6, Length:=4).Font
.FontStyle = "Bold"
.Size = 10
.ColorIndex = 3
End With
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top