check for new item in a list

neilp

Well-known Member
Joined
Jul 5, 2004
Messages
529
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a sheet (2023) that has a a list of products in column C. This list is added to frequently. Most times, the product already exists. Is there a way that if a "New" product is added, it is automatically copied over to Sheet2, column A, next unused row?

I'm thinking a worksheet change event, but it is not something I'm familiar with

thanks

Neil
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
@neilp Try like below.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim nr As Long
Dim mtch As Long
Dim ws As Worksheet
Dim ProdLst As Range

If Not Target.Column = 2 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = vbNullString Then Exit Sub

On Error Resume Next
Set ws = Sheets("Sheet2")
nr = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
Set ProdLst = ws.Range("A2:A" & nr)
mtch = WorksheetFunction.Match(Target, ProdLst, 0)

If Not mtch > 0 Then ws.Cells(nr, 1) = Target

On Error GoTo 0
End Sub

Hope that helps.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,790
Messages
6,126,917
Members
449,348
Latest member
Rdeane

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top