Nlhicks
Active Member
- Joined
- Jan 8, 2021
- Messages
- 264
- Office Version
- 365
- Platform
- Windows
Set Wb = Workbooks.Open("WAPA-UGPR Facility Rating and SOL Record (Data File)_v159.xlsx")
Wb.Sheets("Facility Ratings & SOLs (Lines)").Activate
Set Sheet2 = Sheets("Facility Ratings & SOLs (Lines)")
Set Ws = Sheet2.UsedRange
This code will take the Wb variable and set it equal to the latest version of the workbook but I am telling it to set it equal to the exact one. How can I make this more generic so that it will set it equal to the last version saved? When I close the workbook it automatically up revs to the next version so it would become 160. This code will not work on version 160 it will only work on 159. How can I word it so that it will work on whatever version I am wanting to make changes to?
Wb.Sheets("Facility Ratings & SOLs (Lines)").Activate
Set Sheet2 = Sheets("Facility Ratings & SOLs (Lines)")
Set Ws = Sheet2.UsedRange
This code will take the Wb variable and set it equal to the latest version of the workbook but I am telling it to set it equal to the exact one. How can I make this more generic so that it will set it equal to the last version saved? When I close the workbook it automatically up revs to the next version so it would become 160. This code will not work on version 160 it will only work on 159. How can I word it so that it will work on whatever version I am wanting to make changes to?