Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
2 Conditions + Sum of a colum matching those conditions Jeffa Excel Worksheet Functions 5 June 8th 07 12:14 AM
CF with 4 conditions sahafi Excel Worksheet Functions 13 May 17th 07 03:52 PM
shade cells based on conditions - i have more than 3 conditions Mo2 Excel Worksheet Functions 3 March 30th 07 07:19 AM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"