Insurance Dave
New Member
- Joined
- Jul 1, 2020
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
Hello Everyone,
Getting older, but not so much wiser. My VBA skills were always lacking, but now they are also 15 years out of practice. I would post the attempts I have made, but it would be embarrassing...![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
I am looking for VBA code to copy an entire sheet from one workbook to an existing, already named sheet within another workbook based on the name of the source workbook and the name of the destination tab/worksheet.
The source workbook is created by exporting data from another source into a new Excel Workbook. There is only ever one worksheet in this workbook - "Claim Specific AFO Claim Handle". Once imported, the source workbook will be manually saved as today's date in the mm-dd-yyyy.xlsx format (i.e. 03-26-2024.xlsx) within a folder on the User's Desktop named WLB. The Workbook can either be closed at this time or remain open - pending responses from everyone here on the best choice for this application.
In the User's workbook, I am looking to have a button with the VBA assigned, to copy the worksheet from the most recently saved source workbook and paste the data into a specific tab within the User's workbook, overwriting any and all previous data on that tab/within that worksheet. The code would need to identify that 04/02/2024 is more recent than 04/01/2025 or 03/29/2024, etc. So, data copied and pasted on 04-01-2024 will be overwritten with the data from the 04-02-2024 workbook/worksheet and so-on. The number of columns and rows may vary from day-to-day within the source worksheet. There should never be more than 250 columns or rows.
This will be a daily process for the User (mostly workdays).
Source Workbook Location - C:\Users\****\Desktop\WLB\
Source Workbook Name will be date driven - mm-dd-yyyy.xlsx
Source Worksheet Name / Tab Name (only sheet within the workbook) - "Claim Specific AFO Claim Handle"
User's Workbook will be open
User's Worksheet Name where data is to be copied to - "MM_YYYY_Data" where the "MM" and the "YYYY" will be the month and year based on the date of the most recently saved sourcebook - with the paste starting in Cell A1. So, if the most recent source workbook in the WLB folder is 04-02-2024.xlsx, the data will be pasted to the User's Workbook within the sheet named April_2024_Data.
Numerous other tabs/worksheets/cells within the User's Workbook will be formulae driven based on the data that is pasted to the designated worksheet (mostly vlookups) - in case ScreenUpdating or something else would be a factor.
Hopefully, this is enough information to go on. I thank anyone/everyone in advance for any help with this.
Dave
Getting older, but not so much wiser. My VBA skills were always lacking, but now they are also 15 years out of practice. I would post the attempts I have made, but it would be embarrassing...
![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
I am looking for VBA code to copy an entire sheet from one workbook to an existing, already named sheet within another workbook based on the name of the source workbook and the name of the destination tab/worksheet.
The source workbook is created by exporting data from another source into a new Excel Workbook. There is only ever one worksheet in this workbook - "Claim Specific AFO Claim Handle". Once imported, the source workbook will be manually saved as today's date in the mm-dd-yyyy.xlsx format (i.e. 03-26-2024.xlsx) within a folder on the User's Desktop named WLB. The Workbook can either be closed at this time or remain open - pending responses from everyone here on the best choice for this application.
In the User's workbook, I am looking to have a button with the VBA assigned, to copy the worksheet from the most recently saved source workbook and paste the data into a specific tab within the User's workbook, overwriting any and all previous data on that tab/within that worksheet. The code would need to identify that 04/02/2024 is more recent than 04/01/2025 or 03/29/2024, etc. So, data copied and pasted on 04-01-2024 will be overwritten with the data from the 04-02-2024 workbook/worksheet and so-on. The number of columns and rows may vary from day-to-day within the source worksheet. There should never be more than 250 columns or rows.
This will be a daily process for the User (mostly workdays).
Source Workbook Location - C:\Users\****\Desktop\WLB\
Source Workbook Name will be date driven - mm-dd-yyyy.xlsx
Source Worksheet Name / Tab Name (only sheet within the workbook) - "Claim Specific AFO Claim Handle"
User's Workbook will be open
User's Worksheet Name where data is to be copied to - "MM_YYYY_Data" where the "MM" and the "YYYY" will be the month and year based on the date of the most recently saved sourcebook - with the paste starting in Cell A1. So, if the most recent source workbook in the WLB folder is 04-02-2024.xlsx, the data will be pasted to the User's Workbook within the sheet named April_2024_Data.
Numerous other tabs/worksheets/cells within the User's Workbook will be formulae driven based on the data that is pasted to the designated worksheet (mostly vlookups) - in case ScreenUpdating or something else would be a factor.
Hopefully, this is enough information to go on. I thank anyone/everyone in advance for any help with this.
Dave