Reputation: 177
I have a sheet named "State List Generation" in which I have written a code which can extract City and State list from some text. I wanted to run this macro in another sheet which contains the text. I will be able to run this through macro window of excel if the first file is open. The problem is my state and city list is in the first sheet (State List Generation). When i run the macro from the second sheet which has data, the second sheet becomes the active sheet!!. I am not able to point the first excel where the the actual macro is present. Is there any way??
Upvotes: 0
Views: 57
Reputation: 177
I have found the answer from https://support.microsoft.com/en-us/help/291308/how-to-select-cells-ranges-by-using-visual-basic-procedures-in-excel
I have just used Workbooks("FT_State_update.xlsm") to point the particular workbook. Thanks to Maddy Nikam
Upvotes: 1