Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default how to copy the contents from last cell

I have a column of data but I do not know how many cells in column. I want
to copy the last cell from this column. e.g.

Example 1
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=<empty
A9=<empty
.....
and so on cells are empty
....

....

I want B1 = 3431 (A7) because it is the last cell with non empty content


Example 2
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=123
A9=456
A10=<empty
A11=<empty
A12=<empty
---
and so on cell s are empty...

....

I want B1 = 456 (A9) because it is the last cell with non empty content


Thanks in advance.




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 141
Default how to copy the contents from last cell

On Jan 16, 5:20*pm, "Lamb Chop" wrote:
I have a column of data but I do not know how many cells in column. *I want
to copy the last cell from this column. e.g.

Example 1
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=<empty
A9=<empty
....
and so on cells are empty
...

...

I want B1 = 3431 *(A7) *because it is the last cell with non empty content

Example 2
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=123
A9=456
A10=<empty
A11=<empty
A12=<empty
---
and so on cell s are empty...

...

I want B1 = 456 *(A9) *because it is the last cell with non empty content

Thanks in advance.


Add this in a module in VBE, it'll do what your looking for

Sub Try()
Range("B1").Value = Range("A65536").End(xlUp).Value

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default how to copy the contents from last cell

In B1 enter this formula.

=LOOKUP(99^99,A:A) to return last number

=LOOKUP(2,1/(A1:A65535<""),A1:A65535) to return number or text.


Gord Dibben MS Excel MVP

On Thu, 17 Jan 2008 10:20:31 +1100, "Lamb Chop" wrote:

I have a column of data but I do not know how many cells in column. I want
to copy the last cell from this column. e.g.

Example 1
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=<empty
A9=<empty
....
and so on cells are empty
...

...

I want B1 = 3431 (A7) because it is the last cell with non empty content


Example 2
========
A1 = 412
A2 = 343
A3 = 434
A4 = <empty
A5 = 3432
A6 = 34
A7 = 3431
A8=123
A9=456
A10=<empty
A11=<empty
A12=<empty
---
and so on cell s are empty...

...

I want B1 = 456 (A9) because it is the last cell with non empty content


Thanks in advance.




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
copy cell contents to different page adamt1973 Excel Discussion (Misc queries) 1 February 5th 07 04:32 PM
copy cell value not contents D Moran Excel Discussion (Misc queries) 2 April 24th 06 03:29 PM
Data entry - Copy contents of cell typed in one cell to another ce danie Excel Worksheet Functions 2 March 16th 06 06:51 PM
Help - How to copy word doc contents into a cell phdgrrl New Users to Excel 3 February 18th 06 01:52 AM
how do I copy the contents of a cell from one workbook to another Edith F Excel Worksheet Functions 1 May 19th 05 04:51 PM


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