Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default last column of a row

I would like to know the last filled column of a row. I wrote this lastCol =
cells(1, columns.count) that returns 256. But I have only 101 columns filled
with data. So I was expecting lastCol is equal to 101.

I am doing something wrong to find last filled column number. Can you please
help me?

Nazrul
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default last column of a row

Try this

MsgBox Cells(ActiveCell.Row, "IV").End(xlToLeft).Column


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Nazrul" wrote in message ...
I would like to know the last filled column of a row. I wrote this lastCol =
cells(1, columns.count) that returns 256. But I have only 101 columns filled
with data. So I was expecting lastCol is equal to 101.

I am doing something wrong to find last filled column number. Can you please
help me?

Nazrul



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default last column of a row

It works. Thanks Don.

"Don Guillett" wrote:

how about
cells(1, columns.count).end(xltoleft).column

--
Don Guillett
SalesAid Software

"Nazrul" wrote in message
...
I would like to know the last filled column of a row. I wrote this lastCol

=
cells(1, columns.count) that returns 256. But I have only 101 columns

filled
with data. So I was expecting lastCol is equal to 101.

I am doing something wrong to find last filled column number. Can you

please
help me?

Nazrul




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
divide column(x) by column(y) to give column(x/y) in excel? James New Users to Excel 2 April 24th 23 11:46 AM
Referencing date column A & time column B to get info from column TVGuy29 Excel Discussion (Misc queries) 1 January 24th 08 09:50 PM
Return text in Column A if Column B and Column K match jeannie v Excel Worksheet Functions 4 December 13th 07 07:36 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
what formula do i put for column m = column k minus column l in e. jenniss Excel Discussion (Misc queries) 5 January 6th 05 08:18 PM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"