I need a quicker and more efficient way of reformatting date columns. I put together the following code but it only allows me to specify a single column or continuous range.
I would like to be able to quickly identify multiple columns that need to be reformatted.
I would like to be able to input the column letters (a,b,d,e,f ect…) and have each of the respective columns selected for reformatting.
Any ideas on how do to this would be greatly appreciated.
Thanks!
![]()
Sub DateFormat() Dim ActSheet As Worksheet Dim clm Dim frmt Set ActSheet = ActiveSheet clm = InputBox("What Column Do You Need to Reformat?", "Column Selection", "a") frmt = InputBox("Format?", "Format", "dd/mm/yy hhss") If clm = "<>""" Then ElseIf clm = "" Then MsgBox "Form was null. Select range and try again" End If On Error GoTo Etrap Columns(clm).Select With Selection .NumberFormat = frmt End With Etrap: Beep End Sub
Bookmarks