Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Jump to duplicat entries

I have an application where a row is designed to allow a user to put in various product requirements for a product. Column B difines the product code. Because this must be a unique record, a product code can only be used once in the spreadsheet. I'm looking for a way to check for duplicate product codes, and if a duplicate es entered (E.g.: cell B100), Excel would jump to the existing product code (E.g.: B5) to allow further entries within the row

Any ideas

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Jump to duplicat entries


This needs to be placed on the module sheet for the spreadsheet tha
holds your data eg sheet1 Module



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim TargetAddress

Dim Cell As Range
If Target.Column = "B" Then
'action only if change made in product code column
For Each Cell In Range("B1:B" & UsedRange.Count)
' check entered value against all entries in producyt code
If Cell.Address < Target.Address Then
' do not compare target and cell address are the same
If Cell.Value = Target.Value Then
Cell.Select

Target.clear ' clears new entry form column B
or
Target.Rows.Clear ' clears new entry row
Exit For
End If
End If
Next Cell
End If
End Su

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract duplicat values adeel via OfficeKB.com Excel Discussion (Misc queries) 1 November 10th 09 07:48 PM
Key to Jump to end of row Susan Excel Discussion (Misc queries) 2 August 4th 09 10:19 PM
Count letter"B" in one column based on unique value among duplicat Mero Excel Worksheet Functions 4 May 21st 09 12:26 PM
Worksheet Jump TGalin Excel Worksheet Functions 1 March 10th 09 05:55 AM
Combine Multiple Entries with differing amounts of entries Katie Excel Worksheet Functions 2 November 28th 07 09:53 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"