{"id":86,"date":"2019-04-08T18:18:36","date_gmt":"2019-04-08T18:18:36","guid":{"rendered":"https:\/\/keithratner.live\/optionexplicit\/?p=86"},"modified":"2019-08-15T19:03:25","modified_gmt":"2019-08-15T19:03:25","slug":"transferrangedataasarray","status":"publish","type":"post","link":"https:\/\/keithratner.live\/optionexplicit\/transferrangedataasarray\/","title":{"rendered":"TransferRangeDataAsArray"},"content":{"rendered":"<pre>Public Function TransferRangeDataAsArray( _\r\n    rngSource As Range, _\r\n    rngTarget As Range, _\r\n    Optional xlrvd As XlRangeValueDataType = xlRangeValueDefault _\r\n) As Range\r\n    Set TransferRangeDataAsArray = _\r\n        rngTarget.Resize( _\r\n            rngSource.Rows.Count, _\r\n            rngSource.Columns.Count _\r\n        )\r\n    TransferRangeDataAsArray.Value( _\r\n        xlrvd _\r\n    ) = _\r\n        rngSource.Value( _\r\n            xlrvd _\r\n        )\r\n    End Function<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Public Function TransferRangeDataAsArray( _ rngSource As Range, _ rngTarget As Range, _ Optional xlrvd As XlRangeValueDataType = xlRangeValueDefault _ ) As Range Set TransferRangeDataAsArray = _ rngTarget.Resize( _ rngSource.Rows.Count, _ rngSource.Columns.Count _ ) TransferRangeDataAsArray.Value( _ xlrvd _ ) = _ rngSource.Value( _ xlrvd _ ) End Function<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_exactmetrics_skip_tracking":false,"_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":[114],"tags":[166,121,157],"class_list":["post-86","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippet","tag-array","tag-excel","tag-range"],"krwpengineoptions-featuredonwpengineblog":"","jetpack_featured_media_url":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/transferrangedataasarray.png?fit=369%2C162&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgsIIA-1o","jetpack-related-posts":[{"id":60,"url":"https:\/\/keithratner.live\/optionexplicit\/hashiddencolumns\/","url_meta":{"origin":86,"position":0},"title":"HasHiddenColumns","author":"Keith","date":"April 4, 2019","format":false,"excerpt":"Public Function HasHiddenColumns( _ rng As Range _ ) As Boolean Dim _ rngColumn As Range HasHiddenColumns = False For Each rngColumn In rng.Columns If rngColumn.Hidden Then HasHiddenColumns = True End If Next rngColumn End Function Usage: Dim _ wsSource As Worksheet, _ rngSource as Range Set wsSource = ThisWorkbook.Sheets(\"Sheet1\")\u2026","rel":"","context":"In &quot;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":609,"url":"https:\/\/keithratner.live\/optionexplicit\/iscellhighlighted\/","url_meta":{"origin":86,"position":1},"title":"IsCellHighlighted","author":"Keith","date":"May 24, 2024","format":false,"excerpt":"Function IsCellHighlighted(cell As Range) As Boolean IsCellHighlighted = (cell.Interior.ColorIndex <> xlNone)End Function","rel":"","context":"In &quot;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":134,"url":"https:\/\/keithratner.live\/optionexplicit\/trimrange\/","url_meta":{"origin":86,"position":2},"title":"TrimRange","author":"Keith","date":"April 24, 2019","format":false,"excerpt":"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(\u2026","rel":"","context":"In &quot;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"img":{"alt_text":"TrimRange","src":"https:\/\/i0.wp.com\/keithratner.live\/optionexplicit\/wp-content\/uploads\/sites\/29\/2019\/04\/trimrange.png?fit=430%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":186,"url":"https:\/\/keithratner.live\/optionexplicit\/getlastusedrownumberinworksheet\/","url_meta":{"origin":86,"position":3},"title":"GetLastUsedRowNumberInWorksheet","author":"Keith","date":"August 14, 2019","format":false,"excerpt":"Function GetLastUsedRowNumberInWorksheet( _ ws As Worksheet _ ) As Long Dim _ rng As Range, _ rngResults As Range Set rng = _ ws.Cells Set rngResults = _ rng.Find( _ what:=\"*\", _ After:=rng.Cells(1), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False _ ) If _ rngResults Is Nothing\u2026","rel":"","context":"In &quot;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":188,"url":"https:\/\/keithratner.live\/optionexplicit\/getlastusedcolumnnumberinworksheet\/","url_meta":{"origin":86,"position":4},"title":"GetLastUsedColumnNumberInWorksheet","author":"Keith","date":"August 14, 2019","format":false,"excerpt":"Function GetLastUsedColumnNumberInWorksheet( _ ws As Worksheet _ ) As Long Dim _ rng As Range, _ rngResults As Range Set rng = _ ws.Cells Set rngResults = _ rng.Find( _ what:=\"*\", _ After:=rng.Cells(1), _ Lookat:=xlPart, _ LookIn:=xlFormulas, _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False _ ) If _ rngResults Is Nothing\u2026","rel":"","context":"In &quot;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":110,"url":"https:\/\/keithratner.live\/optionexplicit\/deletehiddensourcecolumnsfromtarget\/","url_meta":{"origin":86,"position":5},"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;Snippet&quot;","block_context":{"text":"Snippet","link":"https:\/\/keithratner.live\/optionexplicit\/category\/snippet\/"},"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":[]}],"_links":{"self":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/86","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=86"}],"version-history":[{"count":2,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/posts\/86\/revisions\/197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keithratner.live\/optionexplicit\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}