Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Find cell address of last cell in a column with text

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default Find cell address of last cell in a column with text

Since you already have the last cell adapt the following to get what you want
-

The following example displays four different representations of the same
cell address on Sheet1. The comments in the example are the addresses that
will be displayed in the message boxes.
(Source: http://msdn.microsoft.com/en-us/libr...ffice.11).aspx)

Set mc = Worksheets("Sheet1").Cells(1, 1)
MsgBox mc.Address() ' $A$1
MsgBox mc.Address(RowAbsolute:=False) ' $A1
MsgBox mc.Address(ReferenceStyle:=xlR1C1) ' R1C1
MsgBox mc.Address(ReferenceStyle:=xlR1C1, _
RowAbsolute:=False, _
ColumnAbsolute:=False, _
RelativeTo:=Worksheets(1).Cells(3, 3)) ' R[-2]C[-2]


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Find cell address of last cell in a column with text

Thanks, but not quite what I'm looking for.

I do not know the address of the last cell. I need the spreadsheet to tell
my macro the address of the last non empty cell.

I have column of numbers that may have some empty cells, I need a way for a
macro to determine the last non empty cell in the column. I was hoping to
write a formula on the worksheet that the macro could reference so it would
know where to copy new information.

Or if a function is not possible, a VBA solution would be OK

Thanks


Mike
"Sheeloo" wrote:

Since you already have the last cell adapt the following to get what you want
-

The following example displays four different representations of the same
cell address on Sheet1. The comments in the example are the addresses that
will be displayed in the message boxes.
(Source: http://msdn.microsoft.com/en-us/libr...ffice.11).aspx)

Set mc = Worksheets("Sheet1").Cells(1, 1)
MsgBox mc.Address() ' $A$1
MsgBox mc.Address(RowAbsolute:=False) ' $A1
MsgBox mc.Address(ReferenceStyle:=xlR1C1) ' R1C1
MsgBox mc.Address(ReferenceStyle:=xlR1C1, _
RowAbsolute:=False, _
ColumnAbsolute:=False, _
RelativeTo:=Worksheets(1).Cells(3, 3)) ' R[-2]C[-2]


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Find cell address of last cell in a column with text

Try this:

="D"&MATCH(REPT("z",255),D:D)


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Find cell address of last cell in a column with text

For a worksheet formula, you could do something like this...

="D"&MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)

For a macro solution (which, if you are in a macro, is the best way to get
this)...

LastCellInD = Cells(Rows.Count, "D").End(xlUp).Address(0,0)

--
Rick (MVP - Excel)


"mike in texas" wrote in message
...
Is it possible to return the address of the last non empty cell in a
column.
I've found lots of ways to return the value of the last cell, but I need
the
address e.g. D234.

Thanks

Mike




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Find cell address of last cell in a column with text

Thanks! Works perfectly.

"Teethless mama" wrote:

Try this:

="D"&MATCH(REPT("z",255),D:D)


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default Find cell address of last cell in a column with text

Try the macro (Excel 2003)

Sub LastCellInColumn()
Range("D65536").End(xlUp).Select
MsgBox "Row Number = " & Selection.Row() & ", Column Number = " &
Selection.Column()
End Sub

"mike in texas" wrote:

Thanks, but not quite what I'm looking for.

I do not know the address of the last cell. I need the spreadsheet to tell
my macro the address of the last non empty cell.

I have column of numbers that may have some empty cells, I need a way for a
macro to determine the last non empty cell in the column. I was hoping to
write a formula on the worksheet that the macro could reference so it would
know where to copy new information.

Or if a function is not possible, a VBA solution would be OK

Thanks


Mike
"Sheeloo" wrote:

Since you already have the last cell adapt the following to get what you want
-

The following example displays four different representations of the same
cell address on Sheet1. The comments in the example are the addresses that
will be displayed in the message boxes.
(Source: http://msdn.microsoft.com/en-us/libr...ffice.11).aspx)

Set mc = Worksheets("Sheet1").Cells(1, 1)
MsgBox mc.Address() ' $A$1
MsgBox mc.Address(RowAbsolute:=False) ' $A1
MsgBox mc.Address(ReferenceStyle:=xlR1C1) ' R1C1
MsgBox mc.Address(ReferenceStyle:=xlR1C1, _
RowAbsolute:=False, _
ColumnAbsolute:=False, _
RelativeTo:=Worksheets(1).Cells(3, 3)) ' R[-2]C[-2]


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Find cell address of last cell in a column with text

You're Welcome!


"mike in texas" wrote:

Thanks! Works perfectly.

"Teethless mama" wrote:

Try this:

="D"&MATCH(REPT("z",255),D:D)


"mike in texas" wrote:

Is it possible to return the address of the last non empty cell in a column.
I've found lots of ways to return the value of the last cell, but I need the
address e.g. D234.

Thanks

Mike

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Find cell address of last cell in a column with text

Hi,

You may also try to use the following array formula

="A"&MAX(IF(ROW($A$1:$A$11)*(A1:A11<""),ROW($A$1: $A$11)))

--
Regards,

Ashsih Mathur
Microsoft Excel MVP
www.ashishmathur.com

"mike in texas" wrote in message
...
Is it possible to return the address of the last non empty cell in a
column.
I've found lots of ways to return the value of the last cell, but I need
the
address e.g. D234.

Thanks

Mike

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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
find common text in cell in column in sheet then return total amou leeona Excel Worksheet Functions 1 June 7th 08 04:43 AM
find last cell in range with data, display cell address sevi61 Excel Worksheet Functions 14 October 29th 07 08:36 PM
find email address in a cell Frederique Excel Worksheet Functions 1 July 24th 07 09:27 PM
Is there a way to find the address of a cell with a certain value? Oshtruck user Excel Worksheet Functions 1 August 10th 06 07:57 PM


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