Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Finding last non-empty column in row...

This code works fine:
MsgBox Cells(Rows.Count, "A").End(xlUp).Row

But this does not:
MsgBox Cells(Columns.Count, "2").End(xlLeft).Column

Any ideas how it should be changed to work?

Thanks!
Mika.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Finding last non-empty column in row...

MsgBox Cells(Columns.Count, "2").End(xlLeft).Column

should be xlToLeft rather than xlLeft

"Mika" wrote in message
...
This code works fine:
MsgBox Cells(Rows.Count, "A").End(xlUp).Row

But this does not:
MsgBox Cells(Columns.Count, "2").End(xlLeft).Column

Any ideas how it should be changed to work?

Thanks!
Mika.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding last non-empty column in row...


MsgBox Cells(1, Columns.Count).End(xlToLeft).Column

don't forget when using cells command use numbers without ""

cells(row number,column number)

or
cells(row number, "column letter")


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

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
Finding First Empty Cell in a Column TomHull Excel Discussion (Misc queries) 5 November 9th 09 01:19 AM
Finding First Empty Cell in a Column TomHull Excel Discussion (Misc queries) 0 November 9th 09 12:21 AM
Dynamically finding the last empty row Mike Potocki Excel Programming 3 October 17th 03 04:34 PM
Finding Empty Rows Tom Ogilvy Excel Programming 0 July 16th 03 04:54 PM
Finding Empty Rows Don Guillett[_4_] Excel Programming 0 July 16th 03 04:50 PM


All times are GMT +1. The time now is 07:34 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"