+ Reply to Thread
Results 1 to 3 of 3

automatic printing

  1. #1
    Registered User
    Join Date
    06-20-2005
    Posts
    18

    automatic printing

    hi there

    using excel 97

    i need to be able to print out automatically in excel once information is inputted into excel from a software package called winwedge.

    it is for measuring steel parts and once the operator has measured the part, the measurement is automatically sent to excel.

    it will enter excel into sheet 1. I then copy the data into sheet 2 =SUM(range!R[-2]C[-2]). what i want to happen is as soon as this information is sent into sheet 2, i want it to print it out without pressing any print buttons.

    is this possible??

    if anyone is kind enough to reply, please respond in basic text as i am a bit of a beginner in excel programming. i presume that i have to input macros and have a basic grasp of these.

    if you wish to contact me email address is nwlyrose at aol dot com

    many thanks

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Right click on the tab for Sheet1 (the sheet that pulls the data from Winwedge) and click on 'View Code'. The VBA window will open. At the top right, click the dropdown that says General and choose Worksheet. In the dropdown to the right, select 'Change'. The main window will now show:

    Private Sub Worksheet_Change(ByVal Target As Range)

    End Sub
    ------------------------------------
    enter this code between the two lines of code above:

    Sheets(2).Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets(1).Activate

    the final product should look like this:
    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    Sheets(2).Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets(1).Activate
    End Sub[/vba]
    Note: Sheets(2) is the number of the sheet in the workbook, not the name on the tab! Adjust these references as needed.

    Close the VBA Editor (Alt+Q) to return to your workbook.

    Now, send data from winwedge and sheet2 should auto print.

    Good Luck!

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545

    VBA Programming help needed...

    You wrote:
    hi bruce

    thanks so much for the help with the automatic printing in microsoft excel.

    the code that you sent works a treat!! However......

    it only works for the first time on a new sheet.

    what i want to be able to do is import say 100 numbers per day and each one of them print off individually. how do i get sheet 2 to print off just the new data and not the other data??

    i have enclosed a copy of the sheet that i have deigned. you will see the red numbers on sheet 1. each of these numbers needs a seperate print out, but we also need to keep the numbers for SPC and chart values. i hope i am explaining this clear enough??

    in summary

    when winwedge inputs the data to excel, i need it to print that data on sheet 2 - it does this now thanks to your code

    what i now need it to do is be able to do that up to 100 times per day and print out each individual value but also keep them all for SPC.

    i hope you understand this, if not, please conact me with any questions

    regards
    What you ask will require specific coding to read the current row, set the print area to that row only, print the sheet then clear the print area. You will need assistance from others in the forum with better VBA skills than I possess. I am reposting this hoping someone will jump in with some ideas.

    Bruce

+ 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