Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Font size and color change for selected cell only


I have the following procedure to view the selected cell bigger size,
when I move my cursor I need Font to be changed from 10 size to 18
size.
I made the below procedure.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8

With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


The problem is this when I move the curssor it Increase the size of
Font from 10 to 18, and It should be 10 size when I move to next
cell...

I hope you understand what I mean.

Pls send me reply, how it will be possible.

Regards.

Shahzad Zafar
Madinah
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Font size and color change for selected cell only

Add a single line:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone
Cells.Font.Size = 10
Target.Interior.ColorIndex = 8

With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


--
Gary''s Student - gsnu2007j


"Shazi" wrote:


I have the following procedure to view the selected cell bigger size,
when I move my cursor I need Font to be changed from 10 size to 18
size.
I made the below procedure.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8

With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


The problem is this when I move the curssor it Increase the size of
Font from 10 to 18, and It should be 10 size when I move to next
cell...

I hope you understand what I mean.

Pls send me reply, how it will be possible.

Regards.

Shahzad Zafar
Madinah

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Font size and color change for selected cell only



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone


With Cells.Font
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Target.Interior.ColorIndex = 8
With Target.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


--
Regards,
Tom Ogilvy

"Shazi" wrote:


I have the following procedure to view the selected cell bigger size,
when I move my cursor I need Font to be changed from 10 size to 18
size.
I made the below procedure.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8

With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


The problem is this when I move the curssor it Increase the size of
Font from 10 to 18, and It should be 10 size when I move to next
cell...

I hope you understand what I mean.

Pls send me reply, how it will be possible.

Regards.

Shahzad Zafar
Madinah

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Font size and color change for selected cell only


You may want to add
on error resume next
as the FIRST line WITHIN the macro

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Try this instead, including the line public lastcell
'==============
Public lastcell
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

With Range(lastcell)
.Interior.ColorIndex = xlNone
.Font.Size = 10
End With

With Target
.Font.Size = 18
.Interior.ColorIndex = 8
End With

lastcell = Target.Address
End Sub

'==========
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Shazi" wrote in message
...

I have the following procedure to view the selected cell bigger size,
when I move my cursor I need Font to be changed from 10 size to 18
size.
I made the below procedure.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8

With Selection.Font
.Name = "Arial"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

Application.ScreenUpdating = True

End Sub


The problem is this when I move the curssor it Increase the size of
Font from 10 to 18, and It should be 10 size when I move to next
cell...

I hope you understand what I mean.

Pls send me reply, how it will be possible.

Regards.

Shahzad Zafar
Madinah





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Font size and color change for selected cell only

On Jul 9, 7:00*am, "Don Guillett" wrote:
You may want to add
on error resume next
as the FIRST line WITHIN the macro

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Don Guillett" wrote in message

...



Try this instead, including the line public lastcell
'==============
Public lastcell
Private Sub Worksheet_SelectionChange(ByVal Target As Range)


With Range(lastcell)
.Interior.ColorIndex = xlNone
.Font.Size = 10
End With


With Target
.Font.Size = 18
.Interior.ColorIndex = 8
End With


lastcell = Target.Address
End Sub


'==========
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Shazi" wrote in message
....


I have the following procedure to view the selected cell bigger size,
when I move my cursor I need Font to be changed from 10 size to 18
size.
I made the below procedure.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False


Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 8


With Selection.Font
* * * *.Name = "Arial"
* * * *.Size = 18
* * * *.Strikethrough = False
* * * *.Superscript = False
* * * *.Subscript = False
* * * *.OutlineFont = False
* * * *.Shadow = False
* * * *.Underline = xlUnderlineStyleNone
* * * *.ColorIndex = xlAutomatic
* *End With


Application.ScreenUpdating = True


End Sub


The problem is this when I move the curssor it Increase the size of
Font from 10 to 18, and It should be 10 size when I move to next
cell...


I hope you understand what I mean.


Pls send me reply, how it will be possible.


Regards.


Shahzad Zafar
Madinah- Hide quoted text -


- Show quoted text -


Dear All,

Thank you very much for your support, you solved my big problem which
I was facing on daily routine. Now I am able to view any thing larger
when I click on any cell.

Once again thank you for all,


with best personal regards.

Syed Shahzad Zafar
Madinah
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Information for a cell with multiple color and size Pred Excel Programming 1 June 29th 07 02:20 AM
When I change the font size in a cell the value changes. Value increases with increase in font. Excel Worksheet Functions 5 June 28th 07 11:00 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Default cell comment fill color and font size Shadowman13 Excel Discussion (Misc queries) 2 September 28th 05 08:16 PM
Can you keep a cells BOLD Font, cell color size Trese Excel Discussion (Misc queries) 2 August 23rd 05 03:09 PM


All times are GMT +1. The time now is 12:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"