Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find Last duplicate value in Column A

How do I find last duplicate value in Column A and put it in a cell
B1?

Appreciate all help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Find Last duplicate value in Column A

Sub FindLastDuplicate()
dim lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 2 step -1
if application.countif(Range("A:A"),cells(i,1)) 1 Then
Range("B1").Value = cells(i,1)
exit sub
end if
Next
End Sub

Would be a code approach. Are you looking for a formula instead?

--
Regards,
Tom Ogilvy


" wrote:

How do I find last duplicate value in Column A and put it in a cell
B1?

Appreciate all help


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find Last duplicate value in Column A

This works perfect! Thank you for your help!

On Feb 7, 11:37 am, Tom Ogilvy
wrote:
Sub FindLastDuplicate()
dim lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 2 step -1
if application.countif(Range("A:A"),cells(i,1)) 1 Then
Range("B1").Value = cells(i,1)
exit sub
end if
Next
End Sub

Would be a code approach. Are you looking for a formula instead?

--
Regards,
Tom Ogilvy



" wrote:
How do I find last duplicate value in Column A and put it in a cell
B1?


Appreciate all help- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find Last duplicate value in Column A

Hi Tom,

What if I wanted to find the last duplicate value the following way:

IF this is the data,

A B

1: day1 Jan
2: day1 Feb
3: day1 Mar
4: day2 Apr
5: day2 May
6: day3 June
7: day3 July
8: day5 Aug
9: day5 Sep

How could I display the last value of each type and the respective
column B data (in a textbox):

day1 Mar
day2 May
day3 July
day5 Sep

Thanks!

On Feb 7, 11:53 am, wrote:
This works perfect! Thank you for your help!

On Feb 7, 11:37 am, Tom Ogilvy
wrote:



Sub FindLastDuplicate()
dim lastrow = cells(rows.count,1).End(xlup).row
for i = lastrow to 2 step -1
if application.countif(Range("A:A"),cells(i,1)) 1 Then
Range("B1").Value = cells(i,1)
exit sub
end if
Next
End Sub


Would be a code approach. Are you looking for a formula instead?


--
Regards,
Tom Ogilvy


" wrote:
How do I find last duplicate value in Column A and put it in a cell
B1?


Appreciate all help- Hide quoted text -


- Show quoted text -- 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
How to find duplicate cells in Column a & retrieve column B ghost Excel Discussion (Misc queries) 2 February 22nd 09 05:39 PM
FIND DUPLICATE TEXT IN A COLUMN!!!!!!!!! HERNAN Excel Discussion (Misc queries) 1 October 16th 06 10:38 PM
How can I find duplicate numbers within a column? Ima Bee Ginner Excel Worksheet Functions 1 January 18th 06 09:18 PM
find duplicate numbers in a column? JENNYC Excel Discussion (Misc queries) 5 November 3rd 05 10:05 PM
Find Duplicate Entries by Column cheryl_allison Excel Programming 2 September 4th 05 01:47 AM


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