Formatting part of text in a Cell & shortcut copying Row hieghts

G

Gunjani

1.Is there a macro or otherwise to format i.e Bold,underline etc a part
of text in a cell?

2. Is there a shortcut way of applying hieght of a specific row to other
selected rows.
--
Many Thanks

Gunjani
After a hard fought 1-1 draw, "The best side drew."
- Bill Shankly (Legendary Liverpool Manager)
 
F

Frank Kabel

Hi
one way for your first question: simly select the specific text part in
the formula bar and apply your format
 
D

Don Guillett

1. edit the cell>highlight desired text>change format.
Record a macro if desired.
2. Use a macro to do that. Have a look at rowheight property in vba help.
 
G

Gord Dibben

Gun

For question #1

Sub CellFont()
With ActiveCell.Characters(Start:=1, length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
End Sub

For question #2 Assign to a button or shortcut key combo.

Bob Flanagan macro. For more Bob Flanagan stuff see.........

http://www.add-ins.com/pages.htm

Sub Copy_Row_Height()
Dim srceRange As Range, I As Integer
Dim destRange As Range, tempR As Range
Application.ScreenUpdating = True
On Error Resume Next
Set srceRange = Application.InputBox(prompt:= _
"Select the set of rows whose row heights " & _
"are to be copied", _
Type:=8, Default:=Selection.Address)
If srceRange Is Nothing Then End
Set destRange = Application.InputBox(prompt:= _
"Select any cell on the first row of the " & _
"rows whose heights are to be set equal " & _

"to the previous range", _
Type:=8)
If destRange Is Nothing Then End
On Error GoTo 0
Set destRange = destRange.Cells(1, 1)
Set tempR = srceRange.Cells(1, 1)
If srceRange.Rows.Count > 16000 Then
MsgBox "Please select a range of rows, " & _
"not the entire sheet." & _
" Activity halted."
End
End If
Application.ScreenUpdating = False
For I = 0 To srceRange.Rows.Count - 1
destRange.Offset(I, 0).EntireRow.RowHeight = _
tempR.Offset(I, 0).EntireRow.RowHeight
Next I
End Sub


Gord Dibben Excel MVP
 
G

Gunjani

Hi
one way for your first question: simly select the specific text part in
the formula bar and apply your format
Thank u all
--
Many Thanks

Gunjani
Driving People Insane:
Develop an unnatural fear of staplers
 
G

Gunjani

1. edit the cell>highlight desired text>change format.
Record a macro if desired.
2. Use a macro to do that. Have a look at rowheight property in vba help.
thank u
--
Many Thanks

Gunjani
It is easier to get forgiveness than permission.
-- Stewart's Law of Retroaction
 
G

Gunjani

Gord Dibben said:
Gun

For question #1

Sub CellFont()
With ActiveCell.Characters(Start:=1, length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
End Sub

For question #2 Assign to a button or shortcut key combo.

Bob Flanagan macro. For more Bob Flanagan stuff see.........

http://www.add-ins.com/pages.htm

Sub Copy_Row_Height()
Dim srceRange As Range, I As Integer
Dim destRange As Range, tempR As Range
Application.ScreenUpdating = True
On Error Resume Next
Set srceRange = Application.InputBox(prompt:= _
"Select the set of rows whose row heights " & _
"are to be copied", _
Type:=8, Default:=Selection.Address)
If srceRange Is Nothing Then End
Set destRange = Application.InputBox(prompt:= _
"Select any cell on the first row of the " & _
"rows whose heights are to be set equal " & _

"to the previous range", _
Type:=8)
If destRange Is Nothing Then End
On Error GoTo 0
Set destRange = destRange.Cells(1, 1)
Set tempR = srceRange.Cells(1, 1)
If srceRange.Rows.Count > 16000 Then
MsgBox "Please select a range of rows, " & _
"not the entire sheet." & _
" Activity halted."
End
End If
Application.ScreenUpdating = False
Thank u
--
Many Thanks

Gunjani
Nutritional tip:
Only Irish Coffee provides in a single glass all four
essential food groups: alchohol, caffeine, sugar, and fat.
 

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

Top