PC Review


Reply
Thread Tools Rate Thread

Copying the last used cell only

 
 
Ibrahim Ozer
Guest
Posts: n/a
 
      15th Feb 2008
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
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      15th Feb 2008
Hi,

Put thisd in A1 of worksheet2

=INDEX(Worksheet1!A:A,MATCH(REPT("z",10),Worksheet1!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
>

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      15th Feb 2008
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
>

 
Reply With Quote
 
Ibrahim Ozer
Guest
Posts: n/a
 
      15th Feb 2008
On Feb 15, 12:16*pm, Mike H <Mi...@discussions.microsoft.com> wrote:
> Hi,
>
> Put thisd in A1 of worksheet2
>
> =INDEX(Worksheet1!A:A,MATCH(REPT("z",10),Worksheet1!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 With Quote
 
Ibrahim Ozer
Guest
Posts: n/a
 
      19th Feb 2008
Hello,

The following formula was working perfect; however, it doesn`t copy
the dates. I tried all other combinations of dates but it still
doesn`t work.

Any idea?

On Feb 15, 12:16*pm, Mike H <Mi...@discussions.microsoft.com> wrote:
> Hi,
>
> Put thisd in A1 of worksheet2
>
> =INDEX(Worksheet1!A:A,MATCH(REPT("z",10),Worksheet1!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- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying cell contents from many cells and pasting into one cell MDN Microsoft Excel Misc 7 10th Dec 2007 08:56 PM
Copying format to a new cell, w/o overwriting destination cell contents James C Microsoft Excel Misc 1 18th Oct 2005 08:02 PM
Excel---Copying text from one cell a a sheet to another cell on a =?Utf-8?B?UmVlZXp6enk=?= Microsoft Excel Misc 1 19th Oct 2004 03:36 AM
Making a cell reference in a formula locked when copying to new cell? Lionel B. Dyck Microsoft Excel Discussion 3 19th Oct 2004 01:29 AM
Copying cell contents from a referred cell that is in reference to a "find" cell ZX210 Microsoft Excel Misc 1 26th Dec 2003 06:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:31 AM.