Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find duplicate cells in Column a & retrieve column B | Excel Discussion (Misc queries) | |||
FIND DUPLICATE TEXT IN A COLUMN!!!!!!!!! | Excel Discussion (Misc queries) | |||
How can I find duplicate numbers within a column? | Excel Worksheet Functions | |||
find duplicate numbers in a column? | Excel Discussion (Misc queries) | |||
Find Duplicate Entries by Column | Excel Programming |