+ Reply to Thread
Results 1 to 11 of 11

userform for printing

  1. #1
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    userform for printing

    Hello everyone,

    I have only just started playing with the advanced functions of excel and I am truly amazed, my eyes have been opened. I have limited programming skills but I have learnt a fair bit from reading other posts on here and have worked out a bit by myself, but I need help now.

    Im creating a sheet for some tests that I have to do at work, trying to get them organised and recorded, I could make it basic, but im loving playing with all the advanced stuff and I want to learn more, so I thought this is a good starting place.

    The book is going to have a sheet for every object to be tested and the data will be manually entered into thoes sheets, there will be a sheet at front that will act as a contents page with links to the sheets so its easy to naviagate. I also want the front sheet to have a print button that opens a userfrom that has checkboxes to print witch ever sheets you want in that section.

    I was wondering if there was an easy way to copy the sheets and name them acording to the data on the contents page, instead of manually copying then renaming? Im hoping to have just two sheets as templates, one for contactors and the other for motors.

    The other problem I am having is creating the userforms for printing, is there a way to have them populated with check boxes or some other way of selecting sheets automatically acording to the data in the group, or would I have to do them manually as well?

    Thanks in advance.
    Last edited by blackman87; 04-20-2010 at 03:43 PM.

  2. #2
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: userform for printing

    Forgot to attach the file. Here it is.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: userform for printing

    Just had another idea on making the userform, if i have one userform with 10 check boxes and then rename them acording to which sheet they are to print, then turn the others to not visible. Im working on it now but any help is appreciated.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: userform for printing

    Here's a dynamic form that will list the sheets in any workbook

    SheetsToPrint.zip
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: userform for printing

    Thanks, I have used some of the code and the userform ideas from that to make mine work.

    Im still having trouble with creating the sheets, im still working on it but im very slow with this, im looking everything up.

  6. #6
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184

    Re: userform for printing

    When it comes to the sheets.. Are you using a single sheet as a reference to copy, or do you have different sheets for different products?
    If I assume "Boondooma Unit" is the standard-sheet you want to copy, you could for instance do something like this:

    Please Login or Register  to view this content.
    -----

    Not exactly sure of what you want with the print function, but if you like playing with code, have a look at the following attachments.

    "Book1" overrides the print-function in excel, letting you drag/drop the sheets you want to print and also select a printer.

    "Printpreview" makes an image of the current sheet and displays in a userform as a preview

    combine the two and I'll assume you have what you want
    Attached Files Attached Files
    Last edited by wamp; 04-19-2010 at 04:00 AM. Reason: loads o' typo's

  7. #7
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: userform for printing

    Wow, thanks for that, they are pretty handy. and that link is also a great help.

    I have worked out my print thing as you can see in the attached file. Its there to print a group of files for each station(colum C) the code only needs to be written once so im happy with that. Better than my other idea.

    Adding the sheets is only something im doing for myself, its not necessary, its just for me to learn and have fun with. What I want to be able to do is have the macro run which would create a sheet and rename it for the headings found in the rows. There will be 2 templates one for motors and one for contactors. I was hoping to have it take Colums C:E use thoes headings and make a sheet with that name from a copy of either a motor template or a contactor template.

    The problem im having is getting it to fetch the data from a merged cell, i know you all hate merged cells and im starting to realise why, but im having fun trying to work out how to do it.

    I have started on some code but havnt got really far, just starting to get the hang of formatting it correctly.

    If you have any hints that could help me it would be great.

    Thanks again.
    Attached Files Attached Files

  8. #8
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184

    Re: userform for printing

    ok.. let's simplify; or clarify what to do here.. you want to do the following:
    * Create a new sheet from one of two templates, based on name in a cell value
    * rename the new template according to column C:E (not specified which row??)

    have a look at the following code (untested) and see if you can use that.
    Since you never specified the row, the macro takes hold of the row you've currently selected

    Please Login or Register  to view this content.
    Last edited by wamp; 04-19-2010 at 07:18 AM. Reason: spelling errors

  9. #9
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: userform for printing

    Thank-you,

    What I wanted from the macro is what you have there looped to do that whole contents page, C3:E48 so 46 sheets. Ill have a play with what you have there and see what I can do.

    Thank you very much for this, its definately pointing me in the right direction.

  10. #10
    Registered User
    Join Date
    04-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Talking Re: userform for printing

    Ok thank you all for your help, I have finished the code now, it does everything I wanted, it might be a bit bulky and over the top but it was fun.

    If there are any things I should change in here please let me know, I want to do more so any hints that will make things easier for me ( and you when I need help again ) please let me know.

    Here is the code.

    Please Login or Register  to view this content.


    I have also attached the worksheet, just select E3 in the contents pages and run CreateSheets to see what it does.

    Thanks again everyone
    Attached Files Attached Files

  11. #11
    Forum Contributor wamp's Avatar
    Join Date
    11-10-2008
    Location
    Norway
    MS-Off Ver
    97, 2000 & 2003 (diff. workstations)
    Posts
    184

    Re: userform for printing

    good for you.
    code is a bit bulky, but as long as it works, then who is to blame :-)
    The more code you generate, the more you learn and the better the code gets. (at least I hope so :-p)



    please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!

+ 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