{"id":134,"date":"2019-04-24T23:08:43","date_gmt":"2019-04-24T23:08:43","guid":{"rendered":"https:\/\/keithratner.live\/optionexplicit\/?p=134"},"modified":"2019-04-26T21:01:01","modified_gmt":"2019-04-26T21:01:01","slug":"trimrange","status":"publish","type":"post","link":"https:\/\/keithratner.live\/optionexplicit\/trimrange\/","title":{"rendered":"TrimRange"},"content":{"rendered":"<pre>Public Function TrimRange( _\r\n    rngSource As Range, _\r\n    Optional TrimTop As Integer = 0, _\r\n    Optional TrimBottom As Integer = 0, _\r\n    Optional TrimLeft As Integer = 0, _\r\n    Optional TrimRight As Integer = 0 _\r\n) As Range\r\n    Set TrimRange = _\r\n        rngSource.Offset( _\r\n            rowoffset:=TrimTop, _\r\n            columnoffset:=TrimLeft _\r\n        ).Resize( _\r\n            rngSource.Rows.Count - TrimTop - TrimBottom, _\r\n            rngSource.Columns.Count - TrimLeft - TrimRight _\r\n        )\r\nEnd Function<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Public Function TrimRange( _ rngSource As Range, _ Optional TrimTop As Integer = 0, _ Optional TrimBottom As Integer = 0, _ Optional TrimLeft As Integer = 0, _ Optional TrimRight As Integer = 0 _ ) As Range Set TrimRange = _ rngSource.Offset( _ rowoffset:=TrimTop, _ columnoffset:=TrimLeft _ ).Resize( _ rngSource.Rows.Count &#8211; TrimTop &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":135,"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-134","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\/trimrange.png?fit=430%2C240&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgsIIA-2a","jetpack-related-posts":[{"id":113,"url":"https:\/\/keithratner.live\/optionexplicit\/slicercount\/","url_meta":{"origin":134,"position":0},"title":"SlicerCount","author":"Keith","date":"April 9, 2019","format":false,"excerpt":"Public Function SlicerCount( _ scl As SlicerCacheLevel, _ Optional NonBlankOnly As Boolean = True, _ Optional Verbose As Boolean = True _ ) Dim si As SlicerItem Dim iCount As Integer Dim iVerboseCount As Integer Dim iTotal As Integer iCount = 0 If Verbose Then iVerboseCount = 0 iTotal =\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/slicercount.png?fit=332%2C568&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":96,"url":"https:\/\/keithratner.live\/optionexplicit\/ellipsize\/","url_meta":{"origin":134,"position":1},"title":"Ellipsize","author":"Keith","date":"April 8, 2019","format":false,"excerpt":"Public Function Ellipsize( _ strInput As String, _ Optional MaxLength As Integer = 16 _ ) As String If Len(strInput) > MaxLength Then Ellipsize = Left(strInput, MaxLength) & Chr(133) Else Ellipsize = strInput End If End Function","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/keithratner.live\/optionexplicit\/category\/code\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/ellipsize.png?fit=290%2C237&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":110,"url":"https:\/\/keithratner.live\/optionexplicit\/deletehiddensourcecolumnsfromtarget\/","url_meta":{"origin":134,"position":2},"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":216,"url":"https:\/\/keithratner.live\/optionexplicit\/returnname\/","url_meta":{"origin":134,"position":3},"title":"ReturnName","author":"Keith","date":"September 11, 2019","format":false,"excerpt":"Function ReturnName(ByVal num As Integer) As String ReturnName = Split(Cells(, num).Address, \"$\")(1) End Function","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":134,"position":4},"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":134,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/134","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=134"}],"version-history":[{"count":1,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/134\/revisions\/136"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media\/135"}],"wp:attachment":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}