Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I will check these out to see which is most usefull, initial testing seems to
work for each submission. Thanks for your help! -- Regards VBA.Noob.Confused XP Pro Office 2007 "sebastienm" wrote: Hi, Method1 --------- Resizing the font may (will) resize the column width and the row height, so it may create more issues than good. ANyway, the code bellow works ok. Method2 --------- A less invasive solution would be to have a picture of the cell next to the selected cell that show its contents in larger font. - select an empty cell and do a Copy Picture (in xl 2003 and prior, press SHIFT while clicking menu Edit and the new item Copy Picture shows up) as bitmap. - paste the picture (menu Edit Paste). Say its name is 'Picture 1' - enlarge it a little bit - now in the sheet module, use the code (uses the name of the picture): Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim p As Excel.Picture Set p = ActiveSheet.Pictures("picture 1") p.Formula = "=" & ActiveCell.Address(False, False) End Sub - On book closing, you could just hide the picture. Method1 - COde ------------------- ''' ########## IN SHEET ###################### Private Sub Worksheet_SelectionChange(ByVal Target As Range) ResetToPrevious SetTracker ActiveCell End Sub ''' ########## IN MODULE ###################### Public Type Tracker Range As Range RowHeight As Double ColumnWidth As Double FontSize As Single End Type Public mPrevious As Tracker Public Sub ResetToPrevious() If Not mPrevious.Range Is Nothing Then ''' reset previous range if any With mPrevious .Range.Font.Size = .FontSize .Range.ColumnWidth = .ColumnWidth .Range.RowHeight = .RowHeight Set .Range = Nothing End With End If End Sub Public Sub SetTracker(Target As Range, Optional Size As Long = 24) Dim cell As Range Set cell = Target.Cells(1) With mPrevious Set .Range = cell .ColumnWidth = cell.ColumnWidth .RowHeight = cell.RowHeight .FontSize = Size .Range.Font.Size = Size End With End Sub ''' ##################################### -- Regards, Sébastien <http://www.ondemandanalysis.com <http://www.ready-reports.com "Rick S." wrote: Is it possible to change the text size when a cell is selected? I would like to simulate magnifying the cell contents when a cell is progmatically selected to draw user attention to the cell. Upon leaving that cell the font size would revert to default (its originial format value). Happy New Year! -- Regards VBA.Noob.Confused XP Pro Office 2007 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I change the size of the text in a worksheet tab? | New Users to Excel | |||
Text formatting - Change Font Size | Excel Programming | |||
Change the size of text used in a Form combo box | Excel Discussion (Misc queries) | |||
font size changes w/ control focus | Excel Worksheet Functions | |||
How do I change the text size in a drop down box | Excel Discussion (Misc queries) |