PC Review


Reply
Thread Tools Rate Thread

Counting entries from the right

 
 
Graham Whitehead
Guest
Posts: n/a
 
      5th Jun 2006
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 With Quote
 
 
 
 
Heather Heritage
Guest
Posts: n/a
 
      5th Jun 2006
check out the specialcells method - XLLastCell would POSSIBLY give you the
data you want?
"Graham Whitehead" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      5th Jun 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
Graham Whitehead
Guest
Posts: n/a
 
      6th Jun 2006
Thanks Bob.

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:eCF9n$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting entries Dos Equis Microsoft Excel Worksheet Functions 3 20th Nov 2006 03:24 AM
Counting Entries across a row rowlo-efc Microsoft Excel Discussion 3 5th Sep 2006 09:43 AM
Counting entries Cranky Microsoft Access 4 10th Jan 2006 10:35 PM
Counting entries alexm999 Microsoft Excel Misc 2 20th Oct 2004 04:40 PM
Counting entries Scott Microsoft Excel Programming 0 21st Aug 2003 08:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:09 PM.