VBA Function to Increase the Selected Cell Font.

  • Thread starter Thread starter Shazi
  • Start date Start date
S

Shazi

Hi,

I made one telephone directory in Sheet1, all cells are set to
Arial=10 size.

but I want to increase font size when I click on the phone number in
any cell for easy viewing. if its possible. pls send me the worksheet
event for that.

Best regards.


Shahzad Zafar
Madinah
 
Hi

The code below enlarge the selected cell in column A. Change the column
number as desired.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns(1).Font.Size = 10

If Target.Column = 1 Then
Target.Font.Size = 15
End If
End Sub

Regards
Per
 
Sometime users foil things with a range selection of more than one cell

If Target.Count = 1 And Target.Column = 1 Then
....
 
Hi

The code below enlarge the selected cell in column A. Change the column
number as desired.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns(1).Font.Size = 10

If Target.Column = 1 Then
    Target.Font.Size = 15
End If
End Sub

Regards
Per

"Shazi" <[email protected]> skrev i meddelelsen









- Show quoted text -

Hi,

Thanks for reply, I want to use the same function for more than one
column,
I mean how I can apply the same function From Column A to Z.

currently I am able to zoom the cell value in A column, I have data in
the sheet from Col A to Column H.

what to do now, pls help

Regards

Shahzad
 
Hi Shahzad

This should do it:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim TargetRange As Range
Dim isect

Set TargetRange = Range("A:Z")
Set isect = Intersect(Target, TargetRange)

If Not isect Is Nothing Then
Columns("A:Z").Font.Size = 10
Target.Font.Size = 15
End If
End Sub

Regards,
Per

"Shazi" <[email protected]> skrev i meddelelsen
Hi

The code below enlarge the selected cell in column A. Change the column
number as desired.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns(1).Font.Size = 10

If Target.Column = 1 Then
Target.Font.Size = 15
End If
End Sub

Regards
Per

"Shazi" <[email protected]> skrev i
meddelelsen









- Show quoted text -

Hi,

Thanks for reply, I want to use the same function for more than one
column,
I mean how I can apply the same function From Column A to Z.

currently I am able to zoom the cell value in A column, I have data in
the sheet from Col A to Column H.

what to do now, pls help

Regards

Shahzad
 
Back
Top