rubikscube991
Member
HI everyone.. Thanks for the attention. I searched everywhere but unfortunately couldn't find a solution. Either the macros written are too long or complex for my understanding.
problem : I have a macro in 1 workbook and from that, i need to open another workbook, kept at some location.
Cell C2 contains the folder location & C3 has the file name. Below macro works if the Filename is exactly same.
But problem is the file name updates on daily basis something like : "DCI_V_DOC_REGISTER_DD_MM_YYYY". I want to keep the file name as "DCI_V_DOC_REGISTER" only, so that i dont have to bother about the rest of the filename. I tried adding "*" at file end but its not working. pls help.
thanks in advance.
problem : I have a macro in 1 workbook and from that, i need to open another workbook, kept at some location.
Cell C2 contains the folder location & C3 has the file name. Below macro works if the Filename is exactly same.
But problem is the file name updates on daily basis something like : "DCI_V_DOC_REGISTER_DD_MM_YYYY". I want to keep the file name as "DCI_V_DOC_REGISTER" only, so that i dont have to bother about the rest of the filename. I tried adding "*" at file end but its not working. pls help.
Code:
Sub Open_register()
Sheet1.Rows("2:4").Select
Selection.EntireRow.Hidden = True
a = Sheet1.Range("C2") & "\"
b = Sheet1.Range("C3").Value
Workbooks.Open Filename:=a & b
End Sub
thanks in advance.
Last edited by a moderator: