Anantha Krishna
Member
Hello All,
Please help me for the below requirements
I need to set workbook which is already open with specific name, E.g: If file name is "xyz Filename abc.xlsx", i need to set this workbook with the name Filename, because every time file name will change which is before and after "Filename".
I am using this below code, but it is not working
Thanks in Advance
Anantha
Please help me for the below requirements
I need to set workbook which is already open with specific name, E.g: If file name is "xyz Filename abc.xlsx", i need to set this workbook with the name Filename, because every time file name will change which is before and after "Filename".
I am using this below code, but it is not working
Code:
Dim sWb As Workbook
Dim sWs As Worksheet
Set sWb = Workbooks("*Filename*.xlsx")
Set sWs = aWb.Sheets("sheet1")
Thanks in Advance
Anantha
Last edited by a moderator: