Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default How to know the right most column?

Dear all,

I would like to know how to get the right most column number whose cell has
a value in a row. Can anyone suggest how to do it programatically?
Thanks a lot.

Ivan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default How to know the right most column?

Ivan,
This post shows bottom row and right most column...
http://makeashorterlink.com/?Z53732E0C
Jim Cone
San Francisco, USA

"Ivan"
wrote in message

Dear all,
I would like to know how to get the right most column number whose cell has
a value in a row. Can anyone suggest how to do it programatically?
Thanks a lot.
Ivan
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to know the right most column?

Hi Ivan,

For a specific row, try

LastColInRow = Cells(1, Columns.Count).End(xlToLeft).Column

MsgBox LastInCol

Replace 1 with the required row number.

---
Regards,
Norman



"Ivan" wrote in message
...
Dear all,

I would like to know how to get the right most column number whose cell
has
a value in a row. Can anyone suggest how to do it programatically?
Thanks a lot.

Ivan



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default How to know the right most column?

Hi Ivan,

Try:

With ActiveSheet.UsedRange
MsgBox .Column + .Columns.Count - 1
End With

HTH
--
David


"Ivan" wrote:

Dear all,

I would like to know how to get the right most column number whose cell has
a value in a row. Can anyone suggest how to do it programatically?
Thanks a lot.

Ivan

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
formula : =(column A)+(column B)-(column C). Why won't it work? Kristin Drover Excel Discussion (Misc queries) 3 October 18th 06 08:48 PM


All times are GMT +1. The time now is 06:30 PM.

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"