+ Reply to Thread
Results 1 to 4 of 4

Counting entries from the right

Hybrid View

Guest Counting entries from the... 06-05-2006, 11:10 AM
Guest Re: Counting entries from the... 06-05-2006, 12:35 PM
Guest Re: Counting entries from the... 06-05-2006, 12:55 PM
Guest Re: Counting entries from the... 06-06-2006, 04:10 AM
  1. #1
    Graham Whitehead
    Guest

    Counting entries from the right

    For a while now I have been using some code to determine how far down a
    worksheet the last line of data appears. For example:

    With ActiveSheet
    lngLastRow = .Range("A65536").End(xlUp).Row
    End With

    Does anyone know the equivalent function to count how far out from the left
    (i.e. if there is data in columns A to G) - I'm sure it must exist but
    cannot quite figure it out.

    thanks




  2. #2
    Heather Heritage
    Guest

    Re: Counting entries from the right

    check out the specialcells method - XLLastCell would POSSIBLY give you the
    data you want?
    "Graham Whitehead" <gwhitehead77@hotmail.com> wrote in message
    news:u55DHCLiGHA.4892@TK2MSFTNGP02.phx.gbl...
    > For a while now I have been using some code to determine how far down a
    > worksheet the last line of data appears. For example:
    >
    > With ActiveSheet
    > lngLastRow = .Range("A65536").End(xlUp).Row
    > End With
    >
    > Does anyone know the equivalent function to count how far out from the

    left
    > (i.e. if there is data in columns A to G) - I'm sure it must exist but
    > cannot quite figure it out.
    >
    > thanks
    >
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: Counting entries from the right

    lngLastCol = .range(1,Columns.Count).End(xlToLeft).Column

    based upon row 1

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Graham Whitehead" <gwhitehead77@hotmail.com> wrote in message
    news:u55DHCLiGHA.4892@TK2MSFTNGP02.phx.gbl...
    > For a while now I have been using some code to determine how far down a
    > worksheet the last line of data appears. For example:
    >
    > With ActiveSheet
    > lngLastRow = .Range("A65536").End(xlUp).Row
    > End With
    >
    > Does anyone know the equivalent function to count how far out from the

    left
    > (i.e. if there is data in columns A to G) - I'm sure it must exist but
    > cannot quite figure it out.
    >
    > thanks
    >
    >
    >




  4. #4
    Graham Whitehead
    Guest

    Re: Counting entries from the right

    Thanks Bob.

    "Bob Phillips" <bob.NGs@somewhere.com> wrote in message
    news:eCF9n$LiGHA.764@TK2MSFTNGP03.phx.gbl...
    > lngLastCol = .range(1,Columns.Count).End(xlToLeft).Column
    >
    > based upon row 1
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Graham Whitehead" <gwhitehead77@hotmail.com> wrote in message
    > news:u55DHCLiGHA.4892@TK2MSFTNGP02.phx.gbl...
    >> For a while now I have been using some code to determine how far down a
    >> worksheet the last line of data appears. For example:
    >>
    >> With ActiveSheet
    >> lngLastRow = .Range("A65536").End(xlUp).Row
    >> End With
    >>
    >> Does anyone know the equivalent function to count how far out from the

    > left
    >> (i.e. if there is data in columns A to G) - I'm sure it must exist but
    >> cannot quite figure it out.
    >>
    >> thanks
    >>
    >>
    >>

    >
    >




+ 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