PC Review


Reply
Thread Tools Rate Thread

How to count last column of data

 
 
crapit
Guest
Posts: n/a
 
      4th Jun 2006
Using excel VBa, I can count last row of data using lastrow =
Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
But how to use it for column?


 
Reply With Quote
 
 
 
 
Ardus Petus
Guest
Posts: n/a
 
      4th Jun 2006
lastcol=Worksheets("Spare2").cells(rows.count,1).end(xltoleft).column

HTH
--
AP

"crapit" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> Using excel VBa, I can count last row of data using lastrow =
> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
> But how to use it for column?
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      4th Jun 2006
Worksheets("Spare2").Cells(1,Columns.count).End(xlToLeft).Column

for the last column in the first row

--
HTH

Bob Phillips

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

"crapit" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Using excel VBa, I can count last row of data using lastrow =
> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
> But how to use it for column?
>
>



 
Reply With Quote
 
crapit
Guest
Posts: n/a
 
      4th Jun 2006
didnt work
"Ardus Petus" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> lastcol=Worksheets("Spare2").cells(rows.count,1).end(xltoleft).column
>
> HTH
> --
> AP
>
> "crapit" <(E-Mail Removed)> a écrit dans le message de news:
> (E-Mail Removed)...
>> Using excel VBa, I can count last row of data using lastrow =
>> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
>> But how to use it for column?
>>

>
>



 
Reply With Quote
 
crapit
Guest
Posts: n/a
 
      4th Jun 2006
IT works!
"Bob Phillips" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Worksheets("Spare2").Cells(1,Columns.count).End(xlToLeft).Column
>
> for the last column in the first row
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>
> "crapit" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Using excel VBa, I can count last row of data using lastrow =
>> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
>> But how to use it for column?
>>
>>

>
>



 
Reply With Quote
 
Ardus Petus
Guest
Posts: n/a
 
      4th Jun 2006
Typed too fast!

"crapit" <(E-Mail Removed)> a écrit dans le message de news:
%(E-Mail Removed)...
> didnt work
> "Ardus Petus" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> lastcol=Worksheets("Spare2").cells(rows.count,1).end(xltoleft).column
>>
>> HTH
>> --
>> AP
>>
>> "crapit" <(E-Mail Removed)> a écrit dans le message de news:
>> (E-Mail Removed)...
>>> Using excel VBa, I can count last row of data using lastrow =
>>> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
>>> But how to use it for column?
>>>

>>
>>

>
>



 
Reply With Quote
 
crapit
Guest
Posts: n/a
 
      4th Jun 2006
But how doI get the actual column "R" value?

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Worksheets("Spare2").Cells(1,Columns.count).End(xlToLeft).Column
>
> for the last column in the first row
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>
> "crapit" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Using excel VBa, I can count last row of data using lastrow =
>> Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
>> But how to use it for column?
>>
>>

>
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      4th Jun 2006
myVal = Worksheets("Spare2").Cells(1,Columns.count).End(xlToLeft)

--
HTH

Bob Phillips

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

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Worksheets("Spare2").Cells(1,Columns.count).End(xlToLeft).Column
>
> for the last column in the first row
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>
> "crapit" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Using excel VBa, I can count last row of data using lastrow =
> > Worksheets("Spare2").Cells(Rows.count, 1).End(xlUp).row
> > But how to use it for column?
> >
> >

>
>



 
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
Count cells w/values in column if the data in column a matches cri mdcgpw Microsoft Excel Worksheet Functions 3 11th Jan 2009 09:00 PM
How do I use the Count function for data in every other column? =?Utf-8?B?TWVjaGVsbGU=?= Microsoft Excel Misc 6 13th Aug 2007 02:50 PM
HOW DO I COUNT CELLS WITH DATA BY COLUMN? =?Utf-8?B?V2FycmVu?= Microsoft Excel Worksheet Functions 2 30th Jun 2006 09:53 AM
I need to count data in one colum based on data in another column =?Utf-8?B?TEc=?= Microsoft Excel Worksheet Functions 1 13th Jun 2006 02:41 PM
count data in column zchazman Microsoft Excel Charting 1 6th Jan 2004 05:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 AM.