receipt issue

nivasudeen

New Member
Joined
Apr 21, 2021
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
hi I am Nivasudeen Basheer Mohammed

I am new to vab now only I am learning vab
have created a new vab form I have some doubt pls help me
I have a print button
if I click the print button I want 3 copy of the same receipt in name of customer copy,office copy, data copy
and it wants to show last data last data in the receipt automatily pls help


automatic last data want to come in receipt



VBA Code:



example


Private Sub Button6_Click()
If MsgBox("office COPY ", vbYesNo) = vbYes Then
Range("F2").Value = "Original Copy"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True, IgnorePrintAreas:=False
End If
If MsgBox("Data COPY ", vbYesNo) = vbYes Then
Range("F2").Value = "Duplicate Copy"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True, IgnorePrintAreas:=False
End If
If MsgBox("CUSTOMER COPY", vbYesNo) = vbYes Then
Range("F2").Value = "Triplicate Copy"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True, IgnorePrintAreas:=False
End If
MsgBox "Printing Done"
End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try this :

VBA Code:
Option Explicit

Sub PrntReceipt()

    'If MsgBox("office COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Original Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
    
    'If MsgBox("Data COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Duplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
    
    'If MsgBox("CUSTOMER COPY", vbYesNo) = vbYes Then
        Range("F2").Value = "Triplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
    
MsgBox "Printing Done"

End Sub
 
Upvote 0
Try this :

VBA Code:
Option Explicit

Sub PrntReceipt()

    'If MsgBox("office COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Original Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
 
    'If MsgBox("Data COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Duplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
 
    'If MsgBox("CUSTOMER COPY", vbYesNo) = vbYes Then
        Range("F2").Value = "Triplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
 
MsgBox "Printing Done"

End th
[/QUOTE]

Try this :

VBA Code:
Option Explicit

Sub PrntReceipt()

    'If MsgBox("office COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Original Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
  
    'If MsgBox("Data COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Duplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
  
    'If MsgBox("CUSTOMER COPY", vbYesNo) = vbYes Then
        Range("F2").Value = "Triplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
  
MsgBox "Printing Done"

End Sub

[/COD
[/QUOTE]

Try this :

VBA Code:
Option Explicit

Sub PrntReceipt()

    'If MsgBox("office COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Original Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
   
    'If MsgBox("Data COPY ", vbYesNo) = vbYes Then
        Range("F2").Value = "Duplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
   
    'If MsgBox("CUSTOMER COPY", vbYesNo) = vbYes Then
        Range("F2").Value = "Triplicate Copy"
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False
    'End If
   
MsgBox "Printing Done"

End Sub

thank you so much for your response sir

I am sorry yesterday I forget to mention my receipt is in sheet 3 it's not in the same sheet
and how my data last entry automatical will update in receipt sir
 
Upvote 0
thank you so much for your response sir

I am sorry yesterday I forget to mention my receipt is in sheet 3 it's not in the same sheet
and how my data last entry automatical will update in receipt sir
my data present in sheet 2
if I click to add it will automatical data go to the sheet to then how it will come in receipt sir pls help me

Quote Reply
Report
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top