+ Reply to Thread
Results 1 to 6 of 6

VBA code to print out certain area in a sheet

  1. #1
    Forum Contributor
    Join Date
    08-30-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    141

    VBA code to print out certain area in a sheet

    Hi guys

    I wonder if there is any way to make a code that will print certain area. There is 3 forms in Sheet1 and I already set print area. What i want is that, if I type 1 in a box and click "Print" command button, it will print only form1, if 2, it will print form1 and form2 and if 3, it will print form1, form2 and form3.

    or if I type 2, it will print only form2 but if i want to print all forms or certain forms, i just type 1,2,3 or 1-3. I already attach a dummy.

    Hope someone can help me.

    Thank you

    Imran
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA code to print out certain area in a sheet

    as an option you can try, add a button to your userform
    (for users add a note: 1=print first form, 2=print second form etc)
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: VBA code to print out certain area in a sheet

    Try this code. In this attachment Attachment 180507

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-30-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    141

    Re: VBA code to print out certain area in a sheet

    Dear Thameem

    It really work. i just make a small adjustment. thank you very much

  5. #5
    Forum Contributor thameem127's Avatar
    Join Date
    04-06-2012
    Location
    Jeddah,Saudi Arabia
    MS-Off Ver
    Excel 2003,Excel 2007
    Posts
    321

    Re: VBA code to print out certain area in a sheet

    Dear Imran,

    Mark this thread as solved to view others to know this coding.

    Thanks

    Thameem
    Last edited by thameem127; 09-16-2012 at 10:44 AM.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VBA code to print out certain area in a sheet

    @ imran91

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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