Hi!!
I need a macro where I can highlight a column and change all of the 2 digit years to a 4 digit year (actually, some of the 2 digit years are only 1 digit, e.g. "9" instead of "09").
I have an if then statement that I can use in the column after it, but I'd rather change the actual numbers in the original column, rather than adding another column (and having to keep the original, too).
The statement I had was:
=if(A1>=50,1900+A1,2000+A1)
I just copy dragged down to get the cell numbers for the rest of the column... but using A1 was just for an example, here, it's not necessarily going to be in that column. It needs to be just whichever cells I select.
It seems like it should be pretty simple, but I don't know how to word it in a macro.
Starting Column Example:
[TABLE="width: 48"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"]12
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]13
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]99
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]11
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]9
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]8
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]97
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[/TR]
</tbody>[/TABLE]
Ending Column Example:
[TABLE="width: 48"]
<tbody>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent, align: right"]2012
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2013
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2014
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]1999
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2011
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2009
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2008
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2006
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2014
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]1997
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2000
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2001
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2002
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2003
[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated.
Thank you!!!
Edit: for some reason I can't get rid of the borders... weird, lol.
I need a macro where I can highlight a column and change all of the 2 digit years to a 4 digit year (actually, some of the 2 digit years are only 1 digit, e.g. "9" instead of "09").
I have an if then statement that I can use in the column after it, but I'd rather change the actual numbers in the original column, rather than adding another column (and having to keep the original, too).
The statement I had was:
=if(A1>=50,1900+A1,2000+A1)
I just copy dragged down to get the cell numbers for the rest of the column... but using A1 was just for an example, here, it's not necessarily going to be in that column. It needs to be just whichever cells I select.
It seems like it should be pretty simple, but I don't know how to word it in a macro.
Starting Column Example:
[TABLE="width: 48"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent, align: right"]12
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]13
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]99
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]11
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]9
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]8
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]97
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]0
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[/TR]
</tbody>[/TABLE]
Ending Column Example:
[TABLE="width: 48"]
<tbody>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent, align: right"]2012
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2013
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2014
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]1999
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2011
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2009
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2008
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2006
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2014
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]1997
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2000
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2001
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2002
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]2003
[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated.

Thank you!!!
Edit: for some reason I can't get rid of the borders... weird, lol.
Last edited: