I for now have my workbook set up this way, in where the workbook is hard coded into the Set command, I am wondering if there is a way of doing this so I can have it where it is fluid? So no matter where this code is place (in another workbook) the code will adapt to it’s new surroundings.
Does this make sense?
Below is what I am using now, what I’d like to have it do is for the ActiveWorkbook or something of the sort be used instead. Since this will be set at the beginning of the code and not the middle.
Set wbOOR = Application.Workbooks("Open Order Report.xlsm")
You’re probably after
Set wbOOR = ThisWorkbookJust to clarify
ThisWorkbookwill always refer to the workbook the code resides inActiveWorkbookwill refer to the workbook that is activeBe careful how you use this when dealing with multiple workbooks. It really depends on what you want to achieve as to which is the best option.