{"id":183,"date":"2012-04-12T16:18:45","date_gmt":"2012-04-12T22:18:45","guid":{"rendered":"http:\/\/www.revivalprojects.com\/journal\/?p=183"},"modified":"2012-04-12T16:18:45","modified_gmt":"2012-04-12T22:18:45","slug":"excel-vba-copy-a-table-column-data-to-another-table-column","status":"publish","type":"post","link":"http:\/\/revivalprojects.com\/journal\/2012\/04\/12\/excel-vba-copy-a-table-column-data-to-another-table-column\/","title":{"rendered":"Excel VBA: Copy a Table Column Data to Another Table Column"},"content":{"rendered":"<p>Update: Added missing &#8216;Sub End&#8217;<\/p>\n<p>On Excel 2010, I created this VBA to copy data from a specific column on a specific table to another table on another spreadsheet to editing the values later without disturbing the original source data.<\/p>\n<p>I am posting it here since I had to do multiple searches for the syntax. <\/p>\n<p><code><\/p>\n<ul>\nSub copyColumn()<br \/>\n    'Delete current values prior to paste if values exist<br \/>\n    If Application.WorksheetFunction.CountA(Range(\"Table2[Column1]\")) <> 0 _<br \/>\n        Then Range(\"Table2[Column1]\").Delete<\/p>\n<p>    'Select desired column to copy with destination option<br \/>\n    Range(\"Table1[[Column3]]\").Copy _<br \/>\n        Destination:=Range(\"Table2[[Column1]]\")<br \/>\nSub End\n<\/ul>\n<p><\/code><\/p>\n<p>If you find this snippet of code useful, leave a comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: Added missing &#8216;Sub End&#8217; On Excel 2010, I created this VBA to copy data from a specific column on a specific table to another table on another spreadsheet to editing the values later without disturbing the original source data. I am posting it here since I had to do multiple searches for the syntax. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3,9],"tags":[20,21,22,23,24,25],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-geeking","category-vba","tag-code","tag-copy","tag-excel","tag-function","tag-paste","tag-vba"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4pNDf-2X","jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/revivalprojects.com\/journal\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}