When Year in Year/month column is current then retain Year/Month value, if year in Year/Month column is prior year then Year/Month2 = Year.
Year/Month Year/Month2 2014/May 2013/april 2014/jan
When Year in Year/month column is current then retain Year/Month value, if year in Year/Month column is prior year then Year/Month2 = Year.
Year/Month Year/Month2 2014/May 2013/april 2014/jan
If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
Mark your thread as Solved
If the suggestion helps you, then Click *below to Add Reputation
if the 1st column is 2014/May then 2nd column is 2014/may
if its 2013/june then 2nd column is 2013
Your condition part is very clear in your first post itself but wants to know the action part only...
Better show the expected result for Year/Month2 column for the given examples for giving exact solution
Year/Month Year/Month2 2014/May 2014/May 2013/april 2013 2014/jan 2014/jan
uhmm.. if i may add.. do you know a code that will not rely on the cell name? but for the column name or ranges.. so that if the user suddenly enters another column.. the codes wont be rendered useless..
Don't know the real need for VBA here... what about a simple formula solution?
In B1 Cell
=IF(LEFT(A2,4)=TRIM(YEAR(TODAY())),A2,LEFT(A2,4))
Drag it down...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks