473,411 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

VBA Excel Find in 2 Column with Count

I'm lost here. I need to count the number or rows that contain different text. In one column, it will be an exact match to the cell. In the other column, the text will be contained within the cell. I'm guessing that I want to create a function that will accept the name of the worksheet and the two search strings and return the count. Any help would be appreciated.
May 27 '10 #1

✓ answered by Guido Geurs

Attached is a zipped XLS with the macro "Find_Rows".
Run it and it will give you a msgbox with "2".

I hope this will help you.

7 2675
Guido Geurs
767 Expert 512MB
@rosshughson
Is it possible to give an example with the original data and what you want to find?
Or better: attach a sheet to your mail with the start data and the expected results.
May 27 '10 #2
I'm attaching a sample worksheet. The code I need will find an exact match in column "E", for example "SR032526" and search the text in column "D" for a specified string - perhaps "SERVICES". With these examples, I would need a function that returned 2, which is the number of rows (row 3 and row 5) that meet those criteria. Thanks.
Attached Files
File Type: txt DeploymentChangeManagementV5ex.txt (5.6 KB, 387 views)
May 27 '10 #3
Sorry - the attachment isn't formatted very well. I don't know how to get around this.
May 27 '10 #4
Guido Geurs
767 Expert 512MB
@rosshughson
Is it not possible to attach just an excel file (zipped) with a sheet and some data?
I have try-ed to import your data TXT file but the contents of the cells are not clear to me.
May 27 '10 #5
OK. Let's try this again. I'm attaching a zipped file.
Attached Files
File Type: zip DeploymentChangeManagementV5ex.zip (129.0 KB, 86 views)
May 27 '10 #6
Guido Geurs
767 Expert 512MB
Attached is a zipped XLS with the macro "Find_Rows".
Run it and it will give you a msgbox with "2".

I hope this will help you.
Attached Files
File Type: zip DeploymentChangeManagementV5ex_1.zip (83.4 KB, 124 views)
May 27 '10 #7
Thanks! This is just what I need. I'll tweak it a bit to make it a reusable function and I should be good to go. Thanks for your help.
May 27 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Aaron C | last post by:
Hi, I'm trying to do an insert with the following statement: INSERT INTO user VALUES ( 'ag@ag.com','ag','Aaron','Chandler','','','La Mirada','CA',90638,714,'',''); and I'm getting the error...
0
by: Tim Cowan | last post by:
Hi How do I get the column count for an HTML table?(System.Web.UI.HtmlControls.HtmlTable) I want to add rows at the beginning of the table for standard header and info text, but the tables...
0
by: Terry Olsen | last post by:
Is there a way to get the total column count in a DataGrid? I can get the total _visible_ columns, but I need to know how many _total_ columns are in my grid. Thanks!
8
by: Doug Bell | last post by:
Hi, I need to create a function that will return the number of columns in a passed reference to a DataView. I can find the number of columns in its underlying Data table but have not been...
0
by: tania | last post by:
i have this table in my database: CREATE TABLE FILM( F_ID INT(5) NOT NULL AUTO_INCREMENT, F_TITLE VARCHAR(40) NOT NULL, DIRECTOR_FNAME VARCHAR(20) NOT NULL, DIRECTOR_LNAME VARCHAR(20) NOT NULL,...
1
by: hartbypass | last post by:
Hello all. I am trying to interate thorugh by GridView data to pump each cell of each row into a stored proc to load to a DB. I seem to be having a heck of a time getting the Columns.Count to...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
0
by: Eric Lindsay | last post by:
Doing a hobby web site at http://www.airliebeachbum.com/ which I intend to eventually style with CSS3. I would like to make a two column layout available via the column-count mechanism, for...
3
by: minhtran | last post by:
Hi all Anyone has any idea how to get a Excel header column in VB.NET. Please, help me. Thank you so much in advance
2
by: lovinjdm | last post by:
When I try to import this database I'm getting a MySQL said: #1136 - Column count doesn't match value count at row 1 and my brain is just not working and I cannot figure out what is wrong.
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.