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

Hi All

I am totally new to excel programming, having never needed to use it
before.
I do however have some experience with visual basic.

I have a really simple spreadsheet, which basically consists of 5
columns. It is used to record what items our A&P team has send to
validation.

Columns are laid out as such:
Description Item-No Inv-Cost PO-Cost Date

What I want to do, is impliment some sort of way, so that the same
item number can't be entered in the Item-No column more than once.

Would it be suitable to use a macro to do this? As I know it would
involve looping around the existing data checking for a match. Or
would it be better to impliment it as a database function?

Thanks in advance, and sorry if this isnt detailed enough, I'm rushing
it through to get to my coffee break.

Thanks
Mick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Unique Macro

Hi

No need for code here - you can use data validation for this.

When your item numbers start from B2, then select the range p.e. B2:B10000,
select from menu Data.Validation, set Allow to Custom and enter the custom
formula
=(COUNTIF($B$2:$B2,$B2)<2)

It's all you need, but you can also edit input message and/or error alert,
when you want.


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)



"Materialised[Work]" wrote in message
om...
Hi All

I am totally new to excel programming, having never needed to use it
before.
I do however have some experience with visual basic.

I have a really simple spreadsheet, which basically consists of 5
columns. It is used to record what items our A&P team has send to
validation.

Columns are laid out as such:
Description Item-No Inv-Cost PO-Cost Date

What I want to do, is impliment some sort of way, so that the same
item number can't be entered in the Item-No column more than once.

Would it be suitable to use a macro to do this? As I know it would
involve looping around the existing data checking for a match. Or
would it be better to impliment it as a database function?

Thanks in advance, and sorry if this isnt detailed enough, I'm rushing
it through to get to my coffee break.

Thanks
Mick



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
Unique print macro question Brad Excel Discussion (Misc queries) 3 June 29th 07 10:20 PM
Problem with my Unique Number Macro...Help? RPIJG[_16_] Excel Programming 2 May 14th 04 01:38 AM
Unique Identifier Macro RPIJG[_7_] Excel Programming 0 May 11th 04 09:36 PM
macro to sub total a unique cell value mary Excel Programming 7 January 17th 04 07:05 PM
Automatically generate a unique file name via macro... Randall Arnold[_2_] Excel Programming 1 July 17th 03 08:56 PM


All times are GMT +1. The time now is 04:14 AM.

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

About Us

"It's about Microsoft Excel"