Yes, of course you can limit code to a selection, or specific range. - it will be easier to advise the best approach if you attach an example workbook, showing how your data is structured and how you identify each separate range to work with.