Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How do I find the last nonempty column in a given row (say row 2)? Lance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, this function will give you the last non-empty cell in the last
column, just change the variable myRow to the row value as you need. Function LastCell(Optional ws As Worksheet) As Range Dim myRow&, myCol&, Rng As Range If ws Is Nothing Then Set ws = ActiveSheet Set Rng = ws.Cells Set LastCell = Rng(1) myRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row myCol = ActiveSheet.Cells(myRow, Columns.Count) _ ..End(xlToLeft).Column On Error Resume Next Set LastCell = Intersect(Rows(myRow), Columns(myCol)) End Function HTH--Lonnie M. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
oops, this will give you the last non-empty cell in the last ROW.
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Consider:
lastCell = Activesheet.Cells(2,Columns.Count).End(xltoLeft) Lance Hoffmeyer wrote: Hello, How do I find the last nonempty column in a given row (say row 2)? Lance |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
numbers or letters?
formula or macro? -- Don Guillett SalesAid Software "Lance Hoffmeyer" wrote in message ... Hello, How do I find the last nonempty column in a given row (say row 2)? Lance |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells(2,256).End(xltoLeft).Column
-- Regards, Tom Ogilvy "Lance Hoffmeyer" wrote in message ... Hello, How do I find the last nonempty column in a given row (say row 2)? Lance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
finding the largest value for a name in a column and then returningthe result from a different column | Excel Worksheet Functions | |||
Finding a number in a column out of an array in another column | Excel Discussion (Misc queries) | |||
Finding Info from Column A and Removing it from Column B | Excel Discussion (Misc queries) | |||
Output from a userform finding the right column. column | Excel Programming | |||
finding and reporting in column A, where a series of column reaches zero | Excel Programming |