Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Synax for two IF conditions in VBA
The expression
=if(D2=D1,C1,"") fills in the contents of cell C2, with the value if C1. WHAT is the syntax in VBA for filling-in C2 with C1's value IF D2-D1, AND E2=E1? Thanks! Steven Rosenberg *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Synax for two IF conditions in VBA
Steven,
Try something like If (Range("D1").Value = Range("D2").Value) And _ (Range("E1").Value = Range("E2").Value) Then Range("C2").Value = Range("C1").Value Else ' do nothing End If -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com "Steven Rosenberg" wrote in message ... The expression =if(D2=D1,C1,"") fills in the contents of cell C2, with the value if C1. WHAT is the syntax in VBA for filling-in C2 with C1's value IF D2-D1, AND E2=E1? Thanks! Steven Rosenberg *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Synax for two IF conditions in VBA
Chip Pearson provided a VBA programming solution because you posted in
the . . . programming newsgroup. Did you want =IF(AND(D1=D2,E1=E2),C1,"") If so, a similar question in the future might best be posted to the ....worksheet.functions newsgroup. Alan Beban Steven Rosenberg wrote: The expression =if(D2=D1,C1,"") fills in the contents of cell C2, with the value if C1. WHAT is the syntax in VBA for filling-in C2 with C1's value IF D2-D1, AND E2=E1? Thanks! Steven Rosenberg *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Synax for two IF conditions in VBA
Thanks for your help. The first proposal looks more like a macro than formula; I'll try it, since that was my original hope, several weeks ago. The Worksheet function group? A URL? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Synax for two IF conditions in VBA
Mr. Pearson:
Thanks your your answer. But how do I make that code work all the way down a column? Steven Rosenberg *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif Conditions - Use of conditions that vary by cell value | Excel Discussion (Misc queries) | |||
2 Conditions + Sum of a colum matching those conditions | Excel Worksheet Functions | |||
CF with 4 conditions | Excel Worksheet Functions | |||
shade cells based on conditions - i have more than 3 conditions | Excel Worksheet Functions | |||
How to multiple conditions to validate more than 2 conditions to . | Excel Worksheet Functions |