If/then statement

awake2424

Registered User.
Local time
Today, 08:52
Joined
Oct 31, 2007
Messages
479
Is it possible in either excel 2003 or 2010 to use an IF/THEN statement to copy select rows that met the criteria? Is it also possible to copy those to another tab on that spreadsheet? In the attached example, when the answet to the IF is "1" Then Row 1 and 4 should be copied to Sheet 1. Thanks.
 
Sorry, the attachment is there now.
 

Attachments

This solution involves only formulas and is good for any Excel version.

This solution is based on inputting a category in B1 of Sheet2.

In Sheet1, a new "helper column" is added with formula in D2:
Code:
=IF(C2=Sheet1!$B$1,COUNT(D$1:D1)+1,"")

copied down. This finds and counts the matches.

Then back in Sheet2, formula in D1:

Code:
=MAX(Master!D:D)

gives a count of matches and is needed for the following formula that extracts the matching rows of information....

In Sheet2, A4:

Code:
 =IF(ROWS($A$1:$A1)>$D$1,"",INDEX(Master!A:A,MATCH(ROWS($A$1:$A1),Master!$D:$D)))

copied down as far as you need, and then across 3 columns.
 

Attachments

Is it possible to use a macro that uses an If/Then critria to asks specific questions?

For example: If there is a message that asks the user to enter a name and Tom Smith is entered, Then another message is displayed that asks for the address and 2547 Maple Drive is entered, Then a message asks the user to enter the City and Durham is entered, Then a message asking for State is displayed and NC is entered. Thank you.
 
I'm sorry, at this time, my expertise is mainly in Excel Formulas and Excel functions like Pivot tables, Data Validation, Conditional Formatting, and other menu features, but not VBA.

I am not sure, but possibly Data Validation may be an alternate for you. It allows users to pick from lists... this avoids typos and forces them to select from existing lists.

Data Validation Intro

Data Validation Dependent Lists.
 
I wondered if this was handled by forms, but not my area of expertise

Brian
 

Users who are viewing this thread

Back
Top Bottom