Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sync Code
Hey guys
I have 2 ranges. A:A and B:B. What is the code that will go through range A:A and if it finds a value that is NOT in range B:B, it will add it. If a value in range A:A is found, then do nothing. Todd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sync Code
Hi Todd,
One way Sub Sync() Dim i As Long Dim cLastB As Long Dim oCell As Range cLastB = Cells(Rows.Count, "B").End(xlUp).Row On Error Resume Next For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row Set oCell = Columns(2).Find(Cells(i, "A").Value) If oCell Is Nothing Then cLastB = cLastB + 1 Cells(cLastB, "B").Value = Cells(i, "A").Value End If Set oCell = Nothing Next i On Error GoTo 0 End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Todd Huttenstine" wrote in message ... Hey guys I have 2 ranges. A:A and B:B. What is the code that will go through range A:A and if it finds a value that is NOT in range B:B, it will add it. If a value in range A:A is found, then do nothing. Todd |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sync Code
Hi Todd
dou you need a VBA solution or would a worksheet formula also work for you?. You may try =SUMPRODUCT(--(COUNTIF(B1:B1000,A1:A1000)=0),A1:A1000) -- Regards Frank Kabel Frankfurt, Germany Todd Huttenstine wrote: Hey guys I have 2 ranges. A:A and B:B. What is the code that will go through range A:A and if it finds a value that is NOT in range B:B, it will add it. If a value in range A:A is found, then do nothing. Todd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sync Excel with Outlook | Excel Discussion (Misc queries) | |||
Mobile sync in Vista | Excel Discussion (Misc queries) | |||
Sync Worksheets in Different Workbooks | Excel Worksheet Functions | |||
Can I sync worksheets within a document? | Excel Discussion (Misc queries) | |||
ProgressBar Out of Sync | Excel Programming |