• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

UserForm'da Aktif sayfayı yazdırmak

Katılım
6 Eylül 2007
Mesajlar
657
Excel Vers. ve Dili
excel 2016 32 Bit ve Excel 2020 32 Bit Türkçe ve İngilizce
Arkadaşlar ekte örnek dosya'da çalışmasını yaptığım UserFormda tüm sayfaları listeliyor ancak seçmiş olduğum sayfayı yazdırtmak istiyorum bu konuda yardımcı olurmusunuz.
 
Sub SheetNavigation()
Dim ws As Worksheet
Application.ScreenUpdating = False
Set dlg = ActiveWorkbook.DialogSheets.Add
With dlg.DialogFrame
.Left = 0
.Top = 0
.Height = 300 ' dialog height
.Width = 300 ' dialog width
End With
dlg.Buttons(1).Left = 245 ' position of button1
dlg.Buttons(2).Left = 245 ' position of button2
With dlg.ListBoxes.Add(10, 15, 230, 275) ' size of listbox
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible Then .AddItem ws.Name
Next ws
.ListIndex = 0
.OnAction = "DisplaySheet"
End With
dlg.DialogFrame.Text = "Select the worksheet you want to activate"
dlg.Visible = False
Application.ScreenUpdating = True
If dlg.Show Then
Worksheets(dlg.ListBoxes(1).List(dlg.ListBoxes(1).ListIndex)).Activate
Application.Dialogs(xlDialogPrint).Show
End If
Application.DisplayAlerts = False
dlg.Delete
Application.DisplayAlerts = True
Set ws = Nothing
Set dlg = Nothing
End Sub

Kırmızı ile yazılı satırı ekleyiniz.
 
tşk.ederim sorunum çözüldü :bravo:
 
Geri
Üst