gtd526
Well-known Member
- Joined
- Jul 30, 2013
- Messages
- 657
- Office Version
- 2019
- Platform
- Windows
Hello,
I want to activate an Open workbook, regardless of the name. I have macros in a custom ribbon (excel), which can be run on any open workbook.
I have a macro that will convert formula to absolute columns only, which works, but I need to activate the workbook.
I have a UserForm that allows me to 'select' the cells to convert. For the Macro to work correctly, I need to Activate that workbook.
Currently I'm using Wildcards to Activate it (if it starts with "N", using 3 characters), but Workbook Names will differ.
Using Code:
For Each wb In Application.Workbooks
If wb.Name Like "N??" Then ' "*Final*" Like *Final*
wb.Activate
Exit For
End If
Next wb
thanks
I want to activate an Open workbook, regardless of the name. I have macros in a custom ribbon (excel), which can be run on any open workbook.
I have a macro that will convert formula to absolute columns only, which works, but I need to activate the workbook.
I have a UserForm that allows me to 'select' the cells to convert. For the Macro to work correctly, I need to Activate that workbook.
Currently I'm using Wildcards to Activate it (if it starts with "N", using 3 characters), but Workbook Names will differ.
Using Code:
For Each wb In Application.Workbooks
If wb.Name Like "N??" Then ' "*Final*" Like *Final*
wb.Activate
Exit For
End If
Next wb
thanks