Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying the last used cell only

Hello All,

I`m the newest member of this group and hoping that some of you could
help me to resolve this problem.

I have a worksheet that contains data, let`s say Worksheet1, A column.
I have another worksheet (Worksheet2). Worksheet1, A column contains
names. Everytime I update it, I don`t delete anything; however, I add
a new name in the following cell in A column.

All I want is to copy the last name entered in Worksheet1, A column to
Worksheet2, A column, Cell1. Anytime new name added, Worksheet2, A
column, Cell1 will be updated.

I`ll really appreciate if you could help me with this.

Thanks v much
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Copying the last used cell only

Hi,

Put thisd in A1 of worksheet2

=INDEX(Worksheet1!A:A,MATCH(REPT("z",10),Worksheet 1!A:A,1),1)

This will dispaly the last used text value in worksheet1 Column A.

Mike

"Ibrahim Ozer" wrote:

Hello All,

I`m the newest member of this group and hoping that some of you could
help me to resolve this problem.

I have a worksheet that contains data, let`s say Worksheet1, A column.
I have another worksheet (Worksheet2). Worksheet1, A column contains
names. Everytime I update it, I don`t delete anything; however, I add
a new name in the following cell in A column.

All I want is to copy the last name entered in Worksheet1, A column to
Worksheet2, A column, Cell1. Anytime new name added, Worksheet2, A
column, Cell1 will be updated.

I`ll really appreciate if you could help me with this.

Thanks v much

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Copying the last used cell only

Paste this into worksheet1 mod
Private Sub Worksheet_Deactivate()
Const colA = "A"
Dim sh1 As Worksheet
Dim sh1LastRow As Long
Set sh1 = Worksheets("Sheet1")
sh1LastRow = FindLastRow(sh1, colA)
Sheet2.Range("A1").Value = Range(colA & sh1LastRow).Value
End Sub

Private Function FindLastRow(whatSheet As Worksheet, whichCol As String) As
Long
'this finds and returns the actual last row on a sheet
'that has entry in specified column
'NOT the next row available for data entry
'so calling routine should add 1 to the returned value
'to determine next row available for new entry
'when it is found that a sheet has no entries, this
'routine will (properly) return zero.

If Val(Left(Application.Version, 2)) < 12 Then
'in pre-2007 Excel
FindLastRow = whatSheet.Range(whichCol & Rows.Count).End(xlUp).Row
Else
'in Excel 2007 or later
FindLastRow = whatSheet.Range(whichCol &
Rows.CountLarge).End(xlUp).Row
End If
If FindLastRow = 1 And IsEmpty(whatSheet.Range(whichCol & "1")) Then
FindLastRow = 0 ' no entries at all in the column on the sheet
End If

End Function

"Ibrahim Ozer" wrote:

Hello All,

I`m the newest member of this group and hoping that some of you could
help me to resolve this problem.

I have a worksheet that contains data, let`s say Worksheet1, A column.
I have another worksheet (Worksheet2). Worksheet1, A column contains
names. Everytime I update it, I don`t delete anything; however, I add
a new name in the following cell in A column.

All I want is to copy the last name entered in Worksheet1, A column to
Worksheet2, A column, Cell1. Anytime new name added, Worksheet2, A
column, Cell1 will be updated.

I`ll really appreciate if you could help me with this.

Thanks v much

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying the last used cell only

On Feb 15, 12:16*pm, Mike H wrote:
Hi,

Put thisd in A1 of worksheet2

=INDEX(Worksheet1!A:A,MATCH(REPT("z",10),Worksheet 1!A:A,1),1)

This will dispaly the last used text value in worksheet1 Column A.

Mike



"Ibrahim Ozer" wrote:
Hello All,


I`m the newest member of this group and hoping that some of you could
help me to resolve this problem.


I have a worksheet that contains data, let`s say Worksheet1, A column.

Thanks a lot!!!!

It worked well.

I have another worksheet (Worksheet2). Worksheet1, A column contains
names. Everytime I update it, I don`t delete anything; however, I add
a new name in the following cell in A column.


All I want is to copy the last name entered in Worksheet1, A column to
Worksheet2, A column, Cell1. Anytime new name added, Worksheet2, A
column, Cell1 will be updated.


I`ll really appreciate if you could help me with this.


Thanks v much- Hide quoted text -


- Show quoted text -


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
Copying cell contents from many cells and pasting into one cell MDN Excel Discussion (Misc queries) 7 December 10th 07 08:56 PM
Copying a cell contents down to the next non-blank cell Math Excel Programming 2 March 21st 07 02:23 PM
Copying format to a new cell, w/o overwriting destination cell contents James C Excel Discussion (Misc queries) 1 October 18th 05 08:02 PM
copying the function contained within a cell to anouther cell. DMB Excel Worksheet Functions 2 September 1st 05 05:49 PM
Copying data down to next dirty cell, then copying that data slarson Excel Programming 0 September 15th 03 09:19 PM


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"