View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
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!