• DİKKAT

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

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
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:
. . .

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

. . .
 
. . .

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
 
Faydalı bir kodmuş.
Bir soru da benden: Sayfa sayısını nasıl ayarlarız?
 
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

. . .
 
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
 


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
 
Geri
Üst