Ben aynı kodlarla seçilen sayfayı PDF yapmak istiyorum ama kod hep hata veriyor.
Microsoft Dosya Uzantıları ve Kodları Sayfası nda da PDF şeklini bulamadım
Userformu konunun ekine yerleştirdim.
Yardım edebilecek olan var mı
- Kod: Tümünü seç
Sub Xlsm_Yap ()
Application.ScreenUpdating = False
Dim txtmsg As String, txttitle As String
Dim txtresult As String, txtdefault As String
Dim JJ As String
JJ = Application.GetSaveAsFilename("YILDIZ", "Microsoft Excel Workbook (*.xlsm), *.xlsm", , "YILDIZ")
If JJ = "False" Then GoTo LastLine
'
Dim i As Integer, n() As String, f As Integer
Dim cnt1 As Integer, cnt2 As Integer
cnt1 = 0
For f = 0 To Me.ListBox1.ListCount
On Error GoTo 1
If Me.ListBox1.Selected(f) Then _
cnt1 = cnt1 + 1
1: Next f
ReDim n(1 To cnt1)
cnt2 = 0
For i = 0 To (Me.ListBox1.ListCount - 1)
On Error Resume Next
If Me.ListBox1.Selected(i) Then
cnt2 = cnt2 + 1
n(cnt2) = Me.ListBox1.list(i)
End If
Next i
On Error GoTo 0
Sheets(n).Copy
Sheets(n).Select
ActiveWorkbook.SaveAs Filename:= _
(JJ), _
FileFormat:=52, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
LastLine:
Application.ScreenUpdating = True
Unload Me
End Sub