问题
I have a column that has data, such as year(date)
or date-365
.
How do I use this text as code, not as text? Meaning, I'd like to be able to do something like
me.ProjectName="ddddd " & MyColumnWithCode
and get ddddd 2017
or ddddd 10/21/2016
I did google in every way I could think of and didn't get anything.
回答1:
You can use:
Me.ProjectName="ddddd " & Eval(MyColumnWithCode)
but not with your present code. It has to read:
Year(Date())
Date()-365
回答2:
Simply write
dddd = sheets("Sheet1").range("a1").value
me.ProjectName= str(ddddd) & MyColumnWithCode 'Str is used in case its a number
来源:https://stackoverflow.com/questions/46861816/storing-code-in-a-column-and-using-it