I have a date in a particular cell (B3) - Date - 12/03/2016. I am trying to assign only the Year part of the date, ie 2016 to a variable. Is it possible?
you can use:
Dim yourvariable%
yourvariable = int(mid([B3],7,4))
or
Dim yourvariable%
yourvariable = int(Right([B3],4))
or
Dim yourvariable%
yourvariable = year(cdate([B3]))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.