Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have a list of products, another list with products sold, i need to make a new list with list of products minus the products sold. ive been working with it, but i cant seem to get it.
thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A VBA solution follows.
The following assumes the list of products and products sold are in Columns A and B respectively starting in Cell A2 and B2 with headings in A1 and B1. The new list will be created in Column C stating in Cell C2 with C1 reserved for a heading. Change references to suit and correct for website word wrap. Sub NewList() Dim Rng1 As Range, Rng2 As Range, C As Range Dim Rw1 As Integer, Rw2 As Integer, i As Integer Rw1 = Range("A65536").End(xlUp).Row Rw2 = Range("B65536").End(xlUp).Row i = 1 Set Rng1 = Range("A2:A" & Rw1) Set Rng2 = Range("B2:B" & Rw2) For Each C In Rng1 If Rng2.Find(C, LookIn:=xlValues, LookAt:=xlWhole) Is Nothing Then i = i + 1 Cells(i, 3) = C End If Next End Sub Regards, Greg (VBA amateur) -----Original Message----- i have a list of products, another list with products sold, i need to make a new list with list of products minus the products sold. ive been working with it, but i cant seem to get it. thank you . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
One change makes many changes | Excel Worksheet Functions | |||
Web toolbar makes me cross | Excel Discussion (Misc queries) | |||
Macro Makes List Box Selection | Excel Discussion (Misc queries) | |||
What makes diferrent? with or without '+' | Excel Worksheet Functions | |||
Can Excel Choose from a List What Makes a Particular Total? | Excel Discussion (Misc queries) |