LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Choosing multiple Criteria to populate a textbox.


Yesterday I posted the snippet of code that is listed

below. Surely there must be a seasoned programmer out there that has

an idea of how to tackle this, even if the below code is totally

changed. This is what I want to do using VBA code:

I have 5 columns, filled with data on my Excel worksheet.
I have a form made up. To fill a textbox on my form I want to be able

to take data from the worksheet with the following criteria:

If column (c) value = "admission" AND column (d) value = "Home" and

a checkbox on my form is checked:

Then the count of the rows that have column (c) with the specified

value AND column (D) with the specified value, will be totalled and

placed in the textbox on the form.

Here is a snippet of code I had done which will count and put the

total in the textbox, but I cannot figure out how to add in the other

criteria of the column (c) value = "admission". The way it is now, it

is totalling all rows in column (D) with a value of "Home". I cannot

figure out how to have multiple criteria being met.


Dim Ct As Integer
Ct = 0

If ckHome2 = True Then
Range("d2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell.Value = "Home" Then
Ct = Ct + 1
txtHome2.Text = Ct
End If



I have been working on this for weeks to no avail. Can someone

please, please, please, please help me with this. Thanks.


--
alonge
------------------------------------------------------------------------
alonge's Profile: http://www.excelforum.com/member.php...o&userid=27874
View this thread: http://www.excelforum.com/showthread...hreadid=476208

 
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
Choosing a date from a list based on two criteria southbaysufer Excel Discussion (Misc queries) 2 October 23rd 09 08:59 PM
Populate Multiple cells when choosing one selection from drop down MMANDIA Excel Discussion (Misc queries) 9 December 3rd 07 11:54 AM
How do I populate an entire row by choosing one cell from a list jumpmaster_france Excel Discussion (Misc queries) 2 August 27th 06 01:45 AM
VBA - Choosing rows based on a criteria [email protected] Excel Programming 3 October 7th 05 12:30 AM
Populate a cell with TextBox info Sony Excel Programming 5 November 1st 04 04:00 PM


All times are GMT +1. The time now is 05:44 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"