我是VBA的新手,上周刚从youtube中学到了。
我希望我的用户表单能够根据日期更改单元格的值。
示例:
(A2:A10): Person name
(B2:B10): Birthday
(C2:C10): Target Cell
如果我想要那个生日的人
在JAN, FEB, MARCH, APRIL
的目标单元格中通过用户表单成为JFMA。
我怎样才能做到这一点?谢谢
答案 0 :(得分:0)
在C列中使用以下公式:
=IF((OR(TEXT(B2,"MMM")="Jan",TEXT(B2,"MMM")="Feb",TEXT(B2,"MMM")="Mar",TEXT(B2,"MMM")="Apr"))=TRUE,"JFMA",IF((OR(TEXT(B2,"MMM")="May",TEXT(B2,"MMM")="Jun",TEXT(B2,"MMM")="Jul",TEXT(B2,"MMM")="Aug"))=TRUE,"MJJA",IF((OR(TEXT(B2,"MMM")="Sep",TEXT(B2,"MMM")="Oct",TEXT(B2,"MMM")="Nov",TEXT(B2,"MMM")="Dec"))=TRUE,"SOND")))