UserForm'da Aktif sayfayı yazdırmak

cocoa35

Altın Üye
Katılım
6 Eylül 2007
Mesajlar
652
Excel Vers. ve Dili
excel 2016 32 Bit ve Excel 2020 32 Bit Türkçe ve İngilizce
Altın Üyelik Bitiş Tarihi
10-12-2024
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.
 
Katılım
13 Aralık 2005
Mesajlar
53
Excel Vers. ve Dili
Office 2003 - Türkçe
Office 2007 - İngilizce
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.
 

cocoa35

Altın Üye
Katılım
6 Eylül 2007
Mesajlar
652
Excel Vers. ve Dili
excel 2016 32 Bit ve Excel 2020 32 Bit Türkçe ve İngilizce
Altın Üyelik Bitiş Tarihi
10-12-2024
tşk.ederim sorunum çözüldü :bravo:
 
Üst