Find Last Entry In Columns
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Find Last Entry In Columns

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    449
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have 5 columns B to I in these I have either 1 or 0.5 I need a macro that that goes down to the last entry in any of these columns and selects the entry in I.

    I am setting it up to create a print area A1 to the active cell I hope this is clear.

  2. #2
    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

    The routine below will get to the last row.

    There are actually 8 columns between B and I so I have assumed that you wanted all of these included in the search and included the code in the macro.

    ***

    Sub FindLastRow()

    Dim AmILast(8)
    Dim Biggest As Double
    Dim PrtRng As String
    Biggest = 0
    For a = 1 To 8
    Range("A65535").Offset(0, a).Select
    Selection.End(xlUp).Select
    AmILast(a) = ActiveCell.Row
    If AmILast(a) > Biggest Then Biggest = AmILast(a)
    Next

    PrtRng = "A1:I" & Biggest

    ' Range(PrtRng).Select
    ActiveSheet.PageSetup.PrintArea = PrtRng

    End Sub

    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    449
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thank you for your help I forgot I had 3 columns hidden I only need to find this data in columns B C G H I sorry if this is harder apart from that it was just what I wanted

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