Yazdır koduna kablosuz yazıcı ekleme

yuemse

Altın Üye
Katılım
28 Eylül 2010
Mesajlar
75
Excel Vers. ve Dili
2016 excel türkçe
Altın Üyelik Bitiş Tarihi
06-04-2025
Aşağıdaki kırmızı renkteki koda kablosuz yazıcıyı nasıl ekleyebirim
Yazıcının adı Canon MX520 series Printer WS
Ya da yazıcı seçme özelliği koyabilirmiyiz.

Kod:
Private Sub CommandButton4_Click()
Application.ScreenUpdating = False
Sheets("FATURA").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
Application.ActivePrinter = "LPT1: üzerindeki EPSON FX Series 1 (80) "
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"LPT1: üzerindeki EPSON FX Series 1 (80) ", Collate:=True
[COLOR="Red"]Sheets("İRSALYE").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
Application.ActivePrinter = "WSD-2e40fcb8-3925-41f7-bd84-e9a2c4614be6.0068: üzerindeki Canon MX520 series Printer WS "
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"WSD-2e40fcb8-3925-41f7-bd84-e9a2c4614be6.0068: üzerindeki Canon MX520 series Printer WS ", Collate:=True[/COLOR]
MsgBox "FATURA YAZDIRILIYOR LÜTFEN BEKLEYİN"
Application.ScreenUpdating = True
End Sub
 
Son düzenleme:

Emir Hüseyin Çoban

Destek Ekibi
Destek Ekibi
Katılım
11 Ağustos 2008
Mesajlar
5,891
Excel Vers. ve Dili
Office 2013 Tr - Win10 x64
. . .

Kod:
Private Sub CommandButton4_Click()
    If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
    Sheets("FATURA").Select
    ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
    Range("A1:K36").PrintOut Copies:=1, preview:=False
    
    If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
    Sheets("İRSALYE").Select
    ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
    Range("A1:K36").PrintOut Copies:=1, preview:=False
    
    MsgBox "FATURA YAZDIRILIYOR LÜTFEN BEKLEYİN"
End Sub
. . .
 

yuemse

Altın Üye
Katılım
28 Eylül 2010
Mesajlar
75
Excel Vers. ve Dili
2016 excel türkçe
Altın Üyelik Bitiş Tarihi
06-04-2025
. . .

Kod:
Private Sub CommandButton4_Click()
    If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
    Sheets("FATURA").Select
    ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
    Range("A1:K36").PrintOut Copies:=1, preview:=False
    
    If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
    Sheets("İRSALYE").Select
    ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
    Range("A1:K36").PrintOut Copies:=1, preview:=False
    
    MsgBox "FATURA YAZDIRILIYOR LÜTFEN BEKLEYİN"
End Sub
. . .
Tam aradığım gibi çok sağolun hocam
 

ZuCChiNi

Altın Üye
Katılım
26 Haziran 2006
Mesajlar
264
Excel Vers. ve Dili
Excel 2016, TR, x32
Altın Üyelik Bitiş Tarihi
10-10-2024
Faydalı bir kodmuş.
Bir soru da benden: Sayfa sayısını nasıl ayarlarız?
 

Emir Hüseyin Çoban

Destek Ekibi
Destek Ekibi
Katılım
11 Ağustos 2008
Mesajlar
5,891
Excel Vers. ve Dili
Office 2013 Tr - Win10 x64
Faydalı bir kodmuş.
Bir soru da benden: Sayfa sayısını nasıl ayarlarız?
. . .

Sadece 1.sayfayı yazdırır.

1 to 2 / 2 to 2 gibi kombinasyonlar değişebilir.

Kod:
Range("A1:B36").PrintOut Copies:=1, [COLOR="Blue"]From:=1, To:=1[/COLOR], preview:=False
. . .
 

ZuCChiNi

Altın Üye
Katılım
26 Haziran 2006
Mesajlar
264
Excel Vers. ve Dili
Excel 2016, TR, x32
Altın Üyelik Bitiş Tarihi
10-10-2024
Teşekkür ederim.
 

yuemse

Altın Üye
Katılım
28 Eylül 2010
Mesajlar
75
Excel Vers. ve Dili
2016 excel türkçe
Altın Üyelik Bitiş Tarihi
06-04-2025
Faydalı bir kodmuş.
Bir soru da benden: Sayfa sayısını nasıl ayarlarız?

Kod:
If TextBox1.Value = "" Then
MsgBox "KOPYA SAYISI GİRİNİZ", vbInformation
Exit Sub
End If
If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
Sheets("FATURA").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
Range("A1:K36").PrintOut Copies:=[COLOR="Red"]TextBox1.Text[/COLOR], preview:=False
End If
bu şekilde yaparsan sıfır değerinide kabul etmez
 

yuemse

Altın Üye
Katılım
28 Eylül 2010
Mesajlar
75
Excel Vers. ve Dili
2016 excel türkçe
Altın Üyelik Bitiş Tarihi
06-04-2025


Kod:
Private Sub CommandButton1_Click()
    
    If OptionButton1.Value = False And OptionButton2.Value = False Then
        
        MsgBox "YAZICI SEÇİNİZ", vbInformation
        
        Exit Sub
    
    End If

        If OptionButton1.Value = True Then
            
            Application.ScreenUpdating = False
            Sheets("FATURA").Select
            ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
            Application.ActivePrinter = "LPT1: üzerindeki EPSON FX Series 1 (80) "
            ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
            "LPT1: üzerindeki EPSON FX Series 1 (80) ", Collate:=True
            Application.ScreenUpdating = True
        
        End If
        
            If OptionButton2.Value = True Then
               
               If TextBox1.Value = "" Then
               
                    MsgBox "KOPYA SAYISI GİRİNİZ", vbInformation
               
                    Exit Sub
               
               End If
                
                If Not Application.Dialogs(xlDialogPrinterSetup).Show Then Exit Sub
                Sheets("FATURA").Select
                ActiveSheet.PageSetup.PrintArea = "$A$1:$K$36"
                Range("A1:K36").PrintOut Copies:=TextBox1.Text, preview:=False
            
            End If
                        
    Application.Visible = True
    UserForm2.Hide
    
End Sub

Private Sub CommandButton2_Click()
    
    Application.Visible = False
    UserForm2.Hide

End Sub
bu benim kullandığım şekli
 
Üst