Based on the file you've posted i guess the main problem is that column A isn't always fillde with data. Is this also the case in the actual file you're working in ?
If so the only thing to do is to wrewrite all code in function of a column that is always filled with data and also always is copied thus present in every sheet you use the data of initiating devices in.
I seem to remember you once said that column C is always filled with data ??