Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Kontich, Vlaanderen, Belgium
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print code of only 1 module (Excel 2003 SP1)

    Hi all,

    I encountered the following problem :
    I have a lot of modules in my Personal.xls. Now I've added another Module with code in it. As I am building up the code from scratch, I want to have a printout of the code from time to time. I select the Module and do a right click. Here I select "Print". This brings up the PrintBox, and there I cannot select the option "Range : Current module". Only the option "Current project" is active (see attached jpg) <img src=/S/confused3.gif border=0 alt=confused3 width=45 height=45> . But this starts printing all modules in my Personal.xls. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    Can someone help me out, please ?

    MTIA

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    You can open a new workbook and drag just the modules you want printed into its project, from the personal.xls workbook. Don't bother saving the new workbook after printing, unless it's of some further value to you.

    Alan

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Before you print, click in the code window of the module you want to print so that you have the blinking cursor in the code somewhere. If the code window is not active, then you will not be able to select "Current module" in the print dialog.
    Legare Coleman

  4. #4
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Kontich, Vlaanderen, Belgium
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Hi, Alan.

    I only read your post today (had a few days off), and also found that Legare send me a solution.
    Yours works, but Legare's also does the trick and does not require me to open a new workbook, so I used his solution.

    But still, thank you for your reply.

    Best regards

  5. #5
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Kontich, Vlaanderen, Belgium
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Legare,

    I used your solution and this works fine.

    Best regards,

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    If you like color-coded prints, there is a utility that lets you convert your code to HTML (with colors!), so you can paste it into a notepad document. Save-as .html file and open in IE and you can print colored code.
    I use the utility to paste colored code on my website.

    http://puremis.net/excel/cgi-bin/click.cgi...VBHTMLMaker.zip
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Jan

    What is the "BB Code" referred to on the website? BB= Bulletin Board??

    Alan

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Yup, it is specific to that site I expect. Similar to the codes you use here.
    I tested it in test area, but it doesn't adhere to lounge syntax so is of no use in hee.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    > it doesn't adhere to lounge syntax

    Hmmm <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15>... substandard then, by the sound of it. <img src=/S/frown.gif border=0 alt=frown width=15 height=15>

    Alan <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    <img src=/S/smile.gif border=0 alt=smile width=15 height=15> But the HTML part works just fine, provided you don't try to do too large modules.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  11. #11
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Yep <img src=/S/yep.gif border=0 alt=yep width=15 height=15>, jokes aside, it's a very nice little app. Looking at the VBA, it might not be too hard to "hack" the BB version into lounge-compatible output. Do you think it's worth asking the author for permission to have a go at this? Wondering too, how easily it could be adapted to other Office apps - there doesn't appear to be anything too XL-specific in there.

    Alan

  12. #12
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    I'll ask.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  13. #13
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Juan Pablo Gonzales permits us to modify the code, so if you like, you can have a stab at it.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  14. #14
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Kontich, Vlaanderen, Belgium
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Hello Jan Karel,

    I downloaded the add-in and activated it in Excel.
    But I cannot figure out how to use it. I ran the code but this gave a messagebox with two macros I could run : Start and EndMe. I ran both, but could not see anything happening.

    Could you please explain to me how to use this utility ?

    MTIA

  15. #15
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print code of only 1 module (Excel 2003 SP1)

    Select your code, then in the VBE choose Tools, and at the bottom 4 new menu entries appear. Use the ones about html (not bb).
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Page 1 of 3 123 LastLast

Posting Permissions

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