Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2010, 11:01 AM
Authorized User
 
Join Date: Jul 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help!!

Hello everyone. I have a small task to be done in excel. There are two columns which contains various numbers. For example

A B

1000 1000
1001 1001
1002 1002
1003 1005
1004 1006
1005 1007
1006
1007

Now in the next column i have to list those numbers that were missing in column B from column A..That is I want to list numbers 1003 and 1004 in column C. The database is pretty huge. So Im looking forward in writing a macro. Thanx a Lot. :)
 
Old August 30th, 2010, 09:09 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

You can do it without macro too.

Write a Countif function in Column C for counting text occuring in each Cell of Column A in Range (B:B).

=COUNTIF(B:B,A1)
=COUNTIF(B:B,A2)

etc

All cells that return Zero would be the ones you need

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old August 31st, 2010, 01:26 AM
Authorized User
 
Join Date: Jul 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Smile But...

Hey thankyou for replying. Well that works!! But the code doesnt work when the numbers are not in order in column A. I get zero even if the numbers are present in column B.
 
Old August 31st, 2010, 01:47 AM
Authorized User
 
Join Date: Jul 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Thanx

Hey thanx Shasur. I got it!! :)









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.