+ Reply to Thread
Results 1 to 6 of 6

Create a button for print

  1. #1
    Registered User
    Join Date
    03-01-2008
    Location
    New Jersey USA
    MS-Off Ver
    2007
    Posts
    32

    Create a button for print

    Hello All,
    I have workbook with three sheets
    Sheet1 is Input, Sheet2 is Database, Sheet3 is output (Receipt)
    I want to insert a button on Input sheet to print Sheet3
    Also clear button.

    Advance thank you to all

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    macro

    Hello

    Record macro for printing receipt. On Input sheet insert 'Command Button' and assign this macro to that button.

    Try this.

  3. #3
    Registered User
    Join Date
    03-01-2008
    Location
    New Jersey USA
    MS-Off Ver
    2007
    Posts
    32
    Thank you I am new user I dont know about macro, HELP PLEASE

  4. #4
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256
    Hello

    See when u open excel go to 'Tools'. There u will find option 'Record macro'. macro records every action u do and saves it in module. U can also assign shortcut to macro. say Ctrl+a. so when u againg press Ctrl+a same actions are repeated.

    Or u may upload sample file. i will try to help u out.

  5. #5
    Registered User
    Join Date
    03-01-2008
    Location
    New Jersey USA
    MS-Off Ver
    2007
    Posts
    32
    Thank you for help
    Here is my first macro, when I click message is "Cannot run the macro may not be available.....or macro disable


    Sub Macro3()
    '
    ' Macro3 Macro
    ' Click "Print Receipt" Printing start invoice sheet
    '
    ' Keyboard Shortcut: Ctrl+p
    '
    Sheets("Invoice").Select
    ExecuteExcel4Macro "PRINT(1,,,2,,,,,,,,2,,,TRUE,,FALSE)"
    Sheets("Input").Select
    Application.MacroOptions Macro:="Macro3", Description:= _
    "Click ""Print Receipt"" Printing start invoice sheet", ShortcutKey:="p"
    Application.Run "'YCC K9test.xlsx'!Macro3"
    Range("D12").Select
    ActiveWorkbook.SaveAs Filename:= _
    "C:\My Documents\RR\YCC K9test.xlsm", _
    FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    ActiveWorkbook.Save
    Application.ActivePrinter = "Brother HL-2040 series on Ne01:"
    ActiveSheet.Shapes("Button 11").Select
    Application.Goto Reference:="Macro3"
    Range("D13").Select
    ActiveWorkbook.Save
    Sheets("Invoice").Select
    ActiveWindow.SmallScroll Down:=-3
    Range("A1").Select
    Application.WindowState = xlMinimized
    Sheets("Input").Select
    ActiveSheet.Shapes("Button 11").Select
    Application.Goto Reference:="Macro3"
    Application.WindowState = xlMinimized
    Range("F14").Select
    End Sub

  6. #6
    Registered User
    Join Date
    03-01-2008
    Location
    New Jersey USA
    MS-Off Ver
    2007
    Posts
    32
    Thank you to help
    Disregard my last post, I got that macro running with command.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1