Setting a print range in a formula
Setting a print range in a formula
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Setting a print range in a formula

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    45
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Is there a way to set a print range via a formula?

    I want the print range to end where a cell = 99.

    Any ideas?

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm heading home now but try the following procedure:

    Do a FIND for "99" inside a loop (Do, if, for)

    Then use the ADDRESS to find where the 99 is located.

    Then setup your PRINTAREA with PAGESETUP.

    Post with any more questions, someone on here will answer.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  3. #3
    Board Regular s-o-s's Avatar
    Join Date
    Apr 2002
    Location
    Kissimmee, Florida
    Posts
    384
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    You can do this using a simple macro, The one I have written assumes that you want it to print from cell A1 to the occurence of "99" in the sheet.

    Sub SetPrtRng()
    Cells.Select
    Selection.Find(What:="99", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False).Activate
    Rng = "A1:" & ActiveCell.Address
    ActiveSheet.PageSetup.PrintArea = Rng
    End Sub

    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com