{"id":137,"date":"2019-04-24T23:25:34","date_gmt":"2019-04-24T23:25:34","guid":{"rendered":"https:\/\/keithratner.live\/optionexplicit\/?p=137"},"modified":"2019-04-26T20:58:26","modified_gmt":"2019-04-26T20:58:26","slug":"transferfontproperties","status":"publish","type":"post","link":"https:\/\/keithratner.live\/optionexplicit\/transferfontproperties\/","title":{"rendered":"TransferFontProperties"},"content":{"rendered":"<pre>Public Sub TransferFontProperties( _\r\n    rngSource As Range, _\r\n    rngTarget As Range _\r\n)\r\n    Dim sf As Font\r\n    Set sf = rngSource.Font\r\n    With rngTarget.Font\r\n        .Name = sf.Name\r\n        .Size = sf.Size\r\n        .Strikethrough = sf.Strikethrough\r\n        .Superscript = sf.Superscript\r\n        .Underline = sf.Underline\r\n        .Color = sf.Color\r\n        .Italic = sf.Italic\r\n        .TintAndShade = sf.TintAndShade\r\n        .Subscript = sf.Subscript\r\n        .Bold = sf.Bold\r\n    End With\r\nEnd Sub<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Public Sub TransferFontProperties( _ rngSource As Range, _ rngTarget As Range _ ) Dim sf As Font Set sf = rngSource.Font With rngTarget.Font .Name = sf.Name .Size = sf.Size .Strikethrough = sf.Strikethrough .Superscript = sf.Superscript .Underline = sf.Underline .Color = sf.Color .Italic = sf.Italic .TintAndShade = sf.TintAndShade .Subscript = sf.Subscript .Bold = sf.Bold End With [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"open","ping_status":"open","sticky":false,"template":"page-templates\/full-width-no-post-thumbnail.php","format":"standard","meta":{"inline_featured_image":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,4,6,3],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-distribution","category-snippets","category-vba"],"krwpengineoptions-featuredonwpengineblog":"","jetpack_featured_media_url":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/TransferFontProperties.png?fit=295%2C283&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgsIIA-2d","jetpack-related-posts":[{"id":190,"url":"https:\/\/keithratner.live\/optionexplicit\/deletebottomrowsfromworksheet\/","url_meta":{"origin":137,"position":0},"title":"DeleteBottomRowsFromWorksheet","author":"Keith","date":"August 14, 2019","format":false,"excerpt":"Note: This method depends on GetLastUsedRowNumberInWorksheet Sub DeleteBottomRowsFromWorksheet( _ ws As Worksheet _ ) Dim _ strStartingEmptyRow As String, _ rngStartingRow As Range, _ rngEmptyRows As Range, _ lngLastRow As Long lngLastRow = _ GetLastUsedRowNumberInWorksheet( _ ws _ ) If lngLastRow = _ -1 Then Exit Sub End If strStartingEmptyRow\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":110,"url":"https:\/\/keithratner.live\/optionexplicit\/deletehiddensourcecolumnsfromtarget\/","url_meta":{"origin":137,"position":1},"title":"DeleteHiddenSourceColumnsFromTarget","author":"Keith","date":"April 9, 2019","format":false,"excerpt":"Public Sub DeleteHiddenSourceColumnsFromTarget( _ rngSource As Range, _ rngTarget As Range _ ) Dim _ rngColumn As Range, _ intSourceColumnInitialOffset As Integer, _ intSourceRowInitialOffset As Integer, _ iColumn As Integer With rngSource.Cells(1, 1) intSourceColumnInitialOffset = .Column intSourceRowInitialOffset = .Row End With For iColumn = rngSource.Columns.Count To 1 Step -1 If\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"DeleteHiddenSourceColumnsFromTarget","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/deletehiddensourcecolumnsfromtarget.png?fit=392%2C288&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":172,"url":"https:\/\/keithratner.live\/optionexplicit\/deletevbacodefromworkbook\/","url_meta":{"origin":137,"position":2},"title":"DeleteVBACodeFromWorkbook","author":"Keith","date":"June 26, 2019","format":false,"excerpt":"Sub DeleteVBACodeFromWorkbook( _ wb As Workbook _ ) Dim _ vbc As VBComponent For Each vbc In wb.VBProject.VBComponents If vbc.Type vbext_ct_Document Then wb.VBProject.VBComponents.Remove vbc End If Next vbc End Sub","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":214,"url":"https:\/\/keithratner.live\/optionexplicit\/deleteinitialcolumnsfromworksheet\/","url_meta":{"origin":137,"position":3},"title":"DeleteInitialColumnsFromWorksheet","author":"Keith","date":"September 11, 2019","format":false,"excerpt":"Note: This function depends on ReturnName Sub DeleteInitialColumnsFromWorksheet( _ ws As Worksheet, _ NumberOfColumns As Integer _ ) With ws .Columns( _ ReturnName( _ 1 _ ) & _ \":\" & _ ReturnName( _ NumberOfColumns _ ) _ ).Delete _ Shift:=xlToLeft End With End Sub","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":72,"url":"https:\/\/keithratner.live\/optionexplicit\/renderlistcontrolheadings\/","url_meta":{"origin":137,"position":4},"title":"RenderListControlHeadings","author":"Keith","date":"April 7, 2019","format":false,"excerpt":"Public Sub RenderListControlHeadings( _ ListControl As Control, _ ColumnHeadingString As String, _ Optional FontWeight As Long = 400, _ Optional OffsetLeft As Long = 8 _ ) Dim ctls As Controls Dim iCtl As Control Dim strControlNameStub As String Dim strLabelNameStub As String Set ctls = ListControl.Parent.Controls strLabelNameStub = \"lbheading_\"\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"RenderListControlHeadings","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/renderlistcontrolheadings.png?fit=576%2C1008&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/renderlistcontrolheadings.png?fit=576%2C1008&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/renderlistcontrolheadings.png?fit=576%2C1008&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":65,"url":"https:\/\/keithratner.live\/optionexplicit\/deleteallfilesinfolder\/","url_meta":{"origin":137,"position":5},"title":"DeleteAllFilesInFolder","author":"Keith","date":"April 4, 2019","format":false,"excerpt":"Public Sub DeleteAllFilesInFolder( _ strPathToFolder As String _ ) Dim _ fs As Object, _ fldr As Object, _ f As Object Set fs = CreateObject(\"Scripting.FileSystemObject\") Set fldr = fs.GetFolder(strPathToFolder) For Each f In fldr.Files Application.StatusBar = _ \"Deleting file \" & _ f.Name & _ \" from folder \"\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"DeleteAllFilesInFolder","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/deleteallfilesinfolder.png?fit=389%2C343&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":1,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":139,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/137\/revisions\/139"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}