1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Copying and pasting from template

Our take

When dealing with dynamic templates in Excel, creating a VBA solution for copying and pasting values can streamline your workflow significantly. Given the similarity between your source and destination templates, a robust approach involves using identifier columns to ensure accurate data transfer, even as column positions change. By focusing on a hard paste of specific columns from the source workbook to the destination, you can maintain data integrity without the overhead of external links. This method allows for flexibility and efficiency, accommodating future changes seamlessly.

I want to build some VBA that lets me Copy and Paste (As special values) from one template to another. The source template looks *extremely* similar to the destination template, but the destination template may add columns before the data I want to copy and paste without the source template doing the same. How would you approach this? I can see Power query or Identifier Columns being the best bet, but both source and destination already have a decent bit of chug on them, so trying to keep as light as possible.

TLDR; Want to Hard Paste (can’t have a link to an external book at the end) Columns B-K from source workbook sheet1 into D-M of recipient workbook sheet1 . Source B-K may become C-L and Recipient D-M may become E-N at any moment and want the code to not worry about that. Feels like It should be super simple but can't think of the most efficient way to do it

submitted by /u/Codenamerondo1
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article