Validation Dropdown Font Size Change

G

G

I understand that there's no way to control the font SIZE for dropdown text
using validation (Excel 2002).

I'm trying to simulate an onfocus event to change the display percentage to
200% when cell D2 is selected, but it isn't working.

Here's the code, can anyone tell me what I'm doing wrong?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$2" Then
ActiveWindow.Zoom = 200
Else
ActiveWindow.Zoom = 100
End If
End Sub

Thanks, in advance, for your help.

G
 
J

Jacob Skaria

Try this.....

If Not Application.Intersect(Target, Range("$D$2")) Is Nothing Then
ActiveWindow.Zoom = 200
Else
ActiveWindow.Zoom = 100
End If

If this post helps click Yes
 
G

G

This doesn't appear to work ... I'm getting INVALID OUTSIDE PROCEDURE (Target
highlighted).
 
G

G

By 'behind the worksheet' do you mean that the code is on in the same object
as the cell (D2)? If so, yes, it is behind the worksheet.
 
J

Jacob Skaria

You should have pasted the code within the procedure/ Please try....

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("$D$2")) Is Nothing Then
ActiveWindow.Zoom = 200
Else
ActiveWindow.Zoom = 100
End If
End Sub
 
J

Jacob Skaria

I mean.........

With wbOriginal.Sheets("Data")
'Loop from 3rd row to 100 row/Col A(1) to G(7)
totRows = .Cells(Rows.Count, "A").End(xlUp).Row
totCols = .Cells(1, Columns.Count).End(xlToLeft).Column

For lngRow = 3 To totRows
For lngCol = 1 To totCols
wbArchive.Sheets("Sheet1").Cells(lngRow - 2, lngCol) = .Cells(lngRow,
lngCol).Value
Next
Next

End With
 
G

G

My b ... figured that out before I read this and it's working, now. Thanks.
One (last) question ... is there an afterupdate method? After this is
updated, I want to move to another cell to restore the original size.

Thanks.
 
G

G

Thanks for your help, Jacob. Actually, the zoom doesn't change unless I
MANUALLY move to another cell. Possible to set it up so that afterupdate,
it moves to another cell (zoom resets)?

Also, I have one other cell that I want to do this for (dropdown zoom) ...
can I just add code to include this cell or do I need another procedure?

Thx.
 

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