English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Microsoft has turned MSDN upside down again and I can't find anything. Those idiots are always re-working MSDN and right now half of Excel is missing. Microsoft's motto seems to be: If it ain't broke, break it.

I need to bold a single word in a cell using Visual Basic. I know how to do it in Excel manually, but I need to be able to program it.

Thanks

Steve

2007-03-13 11:37:44 · 2 answers · asked by blue_prince_of_dallas 2 in Computers & Internet Programming & Design

2 answers

That was correct but not clear

it goes like this

Sheet1.Range( "A1").Characters( 4, 5).Font.Bold = True

Sheet1: is the name of the Sheet in VBA (Not caption)
4: is the number of charactor to start bold from
5: is the length of the text you want it to be bold

You can also use "Underline", "Italic", "Size", etc

Enjoy my profile, I am the VBAXLMan

2007-03-14 00:26:27 · answer #1 · answered by Anonymous · 1 0

With ActiveCell.Characters(Start=10, Length=4).Font
.FontStyle = "Bold"
End With


-------


Where 10 is the location of the first letter and 4 is the length of the word. Not sure why it is showing elipses after the 10, but that should be a comma.

2007-03-13 12:07:05 · answer #2 · answered by Robert San 3 · 0 0

fedest.com, questions and answers