{"id":617,"date":"2019-03-14T14:56:02","date_gmt":"2019-03-14T14:56:02","guid":{"rendered":"http:\/\/www.johnfperry.com\/?p=409"},"modified":"2019-03-14T14:56:02","modified_gmt":"2019-03-14T14:56:02","slug":"excel-macros-to-add-borders-and-fix-dates","status":"publish","type":"post","link":"https:\/\/johnfperry.com\/?p=617","title":{"rendered":"EXCEL: Macros to add borders and Fix dates"},"content":{"rendered":"<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\n\nSub ColumnToDateTime()\n'\n' ColumnToDateTime Macro\n'\n\n'\nActiveCell.Columns(&quot;A:A&quot;).EntireColumn.Select\nSelection.NumberFormat = &quot;yyyy-mm-dd hh:mm:ss&quot;\nEnd Sub\n\n\n\nSub AddBorders()\n'\n' AddBorders Macro\n'\n\n'\nSelection.Borders(xlDiagonalDown).LineStyle = xlNone\nSelection.Borders(xlDiagonalUp).LineStyle = xlNone\nWith Selection.Borders(xlEdgeLeft)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nWith Selection.Borders(xlEdgeTop)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nWith Selection.Borders(xlEdgeBottom)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nWith Selection.Borders(xlEdgeRight)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nWith Selection.Borders(xlInsideVertical)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nWith Selection.Borders(xlInsideHorizontal)\n.LineStyle = xlContinuous\n.ColorIndex = 0\n.TintAndShade = 0\n.Weight = xlThin\nEnd With\nEnd Sub\n\n<\/pre>\n<p>Add buttons.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sub ColumnToDateTime() &#8216; &#8216; ColumnToDateTime Macro &#8216; &#8216; ActiveCell.Columns(&quot;A:A&quot;).EntireColumn.Select Selection.NumberFormat = &quot;yyyy-mm-dd hh:mm:ss&quot; End Sub Sub AddBorders() &#8216; &#8216; AddBorders&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-617","post","type-post","status-publish","format-standard","hentry","category-excel"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/johnfperry.com\/index.php?rest_route=\/wp\/v2\/posts\/617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnfperry.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnfperry.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnfperry.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/johnfperry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=617"}],"version-history":[{"count":0,"href":"https:\/\/johnfperry.com\/index.php?rest_route=\/wp\/v2\/posts\/617\/revisions"}],"wp:attachment":[{"href":"https:\/\/johnfperry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnfperry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnfperry.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}