返回列表 上一主題 發帖

[發問] 資料驗證-下拉式選單-字型大小問題

[發問] 資料驗證-下拉式選單-字型大小問題

Dear all,
是否可以使用VBA將在篩選過程中的字型放大呢?
不然篩選時,不易判讀(字太小)

謝謝各位先進!
1111.gif
Just do it.

回復 1# jsc0518

Dear all,

我在網路上有看到下列語法,是可以觸動下拉式選單該畫面會放大,但我想問是否可以指定在"某一欄位"
因此語法是我只要點該工作表任何一欄位時,它都會放大。


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'updateby Extendoffice
    On Error GoTo LZoom
    Dim xZoom As Long
    xZoom = 100
    If Target.Validation.Type = xlValidateList Then xZoom = 130
LZoom:
    ActiveWindow.Zoom = xZoom
End Sub
Just do it.

TOP

回復 2# jsc0518

請測試看看,謝謝

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'updateby Extendoffice
On Error GoTo LZoom
Dim xZoom As Long
If Target.Column = 6 Then
xZoom = 100
If Target.Validation.Type = xlValidateList Then xZoom = 130
LZoom:
ActiveWindow.Zoom = xZoom
End If
End Sub

TOP

回復 3# samwang
Dear samwang,
太感謝您了,使用狀況就是我想要的,感恩!!
Just do it.

TOP

回復 3# samwang
Dear samwang,
早安您好!
請教兩個問題:
1.我想要在"指定的欄位"才會啟動放大的功能,要怎麼改呢?
2.假設我在 B1、F1、Z1都有下拉是選單,要怎麼改呢?
謝謝您!
Just do it.

TOP

回復 5# jsc0518

2.假設我在 B1、F1、Z1都有下拉是選單,要怎麼改呢?
>> 請測試看看,謝謝

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo LZoom
Dim xZoom As Long
xZoom = 100
If Target.Address = "$B$1" Or Target.Address = "$F$1" Or Target.Address = "$Z$1" Then
If Target.Validation.Type = xlValidateList Then xZoom = 130
End If
LZoom:
ActiveWindow.Zoom = xZoom
End Sub

TOP

回復 6# samwang
Dear samwang,
感謝您的熱心回覆與指導,這語法可以用且實用,謝謝您
Just do it.

TOP

        靜思自在 : 做好事不能少我一人,做壞事不能多我一人。
返回列表 上一主題