+ Reply to Thread
Results 1 to 8 of 8

if i click on a cell, Excel should print (on my printer) only the35 cells below this cell

Hybrid View

  1. #1
    Registered User
    Join Date
    10-30-2012
    Location
    Windsor, CT
    MS-Off Ver
    Excel 2010
    Posts
    7

    if i click on a cell, Excel should print (on my printer) only the35 cells below this cell

    if i click on a cell, Excel should print (on my printer) only the35 cells below this cell

    For example:

    If i click on A1
    printing option box should open up, and if i click on print, it should only print from A2 to A37, and nothing else on the sheet.

    Thank you for your help!!!

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    See below. This will print 35 rows below the active cell

    [CODE]Dim pArea As String
    Dim x As String
    Dim y As String


    x = ActiveCell.Address(1, 1)
    y = ActiveCell.Offset(35, 0).Address


    ActiveSheet.PageSetup.PrintArea = x & ":" & y[CODE]

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    Dim pArea As String
    Dim x As String
    Dim y As String
    
    
    x = ActiveCell.Address(1, 1)
    y = ActiveCell.Offset(35, 0).Address
    
    
    ActiveSheet.PageSetup.PrintArea = x & ":" & y

  4. #4
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    sorry forgot absolute cell address for second string..see below

    Dim pArea As String
    Dim x As String
    Dim y As String
    
    
    x = ActiveCell.Address(1, 1)
    y = ActiveCell.Offset(35, 0).Address(1,1)
    
    
    ActiveSheet.PageSetup.PrintArea = x & ":" & y

  5. #5
    Registered User
    Join Date
    10-30-2012
    Location
    Windsor, CT
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    It shouldn't be the active cell. It has to be cells below a specific cell...say D13. If i click on D13 (and only this cell), then 35 rows below this cell should print. I have information on other cells in this sheet where i will be clicking and i don't want anything printed there. I hope this makes sense...

    thanks!

  6. #6
    Registered User
    Join Date
    10-30-2012
    Location
    Windsor, CT
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    Also, where should i paste this code? when i open the VB code, should i paste in the MODULE section or in SHEET1 ?

  7. #7
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    more specifically, go to the Developer tab of the ribbon, click Visual Basic, click Insert from Menu Bar, click Module. Then type "Sub Macro1" then hit enter
    put the code after the Sub Macro1 line but before the End Sub

  8. #8
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: if i click on a cell, Excel should print (on my printer) only the35 cells below this c

    just click on the cell then run the macro...so if you want D13 and 35 rows below, click on D13. THen run the macro. All the macro does it sets your print area. Then you can just click print like you normally would do.

    Go to Visual Basic, insert a module, and post the code there

+ 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