View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RS RS is offline
external usenet poster
 
Posts: 113
Default 2 different ?'s: Date? Macro?

Dear Bob,

Thanks for your suggestion. Your equation works without giving an
error. However, because I want different text to appear on different days, I
modified my formula to work as follows:
=IF(TEXT(C8,"MMDD")="1031","text",IF(TEXT(C8,"MMDD ")="0115","text2",IF(TEXT(C8,"MMDD")="0417","text3 ",""))).

Would there be a shorter equation to this? Also, it seems like I
might need to repost the 2nd question regarding macros again (unless you or
someone you know might be able to solve my problem).

"Bob Phillips" wrote:

=IF(OR(TEXT(C8,"MMDD")="1031",TEXT(C8,"MMDD")="011 5",TEXT(C8,"MMDD")="0417")
,"text","")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"RS" wrote in message
...
Question 1:
How would I modify the formula below to include other dates? I
tried the following but get an #VALUE! error:
=IF(TEXT(C8,"MMDD")=OR("1031","0115","0417"),"text ","")
My original formula works, but is only for 1 day:
=IF(TEXT(C8,"MMDD")="1031","text","")

Question 2:
I know that Excel 2000 disables the autofilter function when
the worksheet is protected and hence copied and modified a macro into
"ThisWorkbook" that would fix this. However, I also just read that the
sorting function is also disabled in Excel 2000. So my question is...how
would I modify my existing macro (or add a new macro) to also allow me to
sort? Here is the macro that I have in "ThisWorkbook":

Private Sub Workbook_Open()
'check for filter, turn on if none exists
With Worksheets("Worksheet")
If Not .AutoFilterMode Then
.Range("A1").AutoFilter
End If
.EnableAutoFilter = True
.Protect Password:="temp", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub