Trying to find a way to fill in the rest of a row if it is a dupli
I have a large spread sheet that has a list of numbers and letters in one
column, and the rows are filled with other information like title, yes or no, any other number&letter connected to it,and some other things. I have filled in some of the information for some of these, but i see that there are duplicates(which i need to keep). Is there a way i could condition the cells, or have a function, to fill in the rest of the row if it is a duplicate? (just filling in what the first duplicate has or the previous duplicate so it would do this throughout the document?) Any suggestions will be helpful! :) |
Trying to find a way to fill in the rest of a row if it is a dupli
Here's a code way
Sub CopyDuplicates() Dim iLastRow As Long Dim i As Long Dim cell As Range iLastRow = Cells(Rows.Count, "A").End(xlUp).Row For i = 2 To iLastRow Set cell = Nothing Set cell = Range("A1:A" & i - 1).Find(Cells(i, "A").Value) If Not cell Is Nothing Then cell.EntireRow.Copy Cells(i, "A") End If Next i End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Robert Brown" wrote in message ... I have a large spread sheet that has a list of numbers and letters in one column, and the rows are filled with other information like title, yes or no, any other number&letter connected to it,and some other things. I have filled in some of the information for some of these, but i see that there are duplicates(which i need to keep). Is there a way i could condition the cells, or have a function, to fill in the rest of the row if it is a duplicate? (just filling in what the first duplicate has or the previous duplicate so it would do this throughout the document?) Any suggestions will be helpful! :) |
Trying to find a way to fill in the rest of a row if it is a dupli
I am trying to find a function/condition that maybe able to do this, thanks
for the input though! "Bob Phillips" wrote: Here's a code way Sub CopyDuplicates() Dim iLastRow As Long Dim i As Long Dim cell As Range iLastRow = Cells(Rows.Count, "A").End(xlUp).Row For i = 2 To iLastRow Set cell = Nothing Set cell = Range("A1:A" & i - 1).Find(Cells(i, "A").Value) If Not cell Is Nothing Then cell.EntireRow.Copy Cells(i, "A") End If Next i End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) |
All times are GMT +1. The time now is 08:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com