Hi,
Put this code either before or after the current code.
If the other VBA code also operates on the same sheet on which you want this code to operate then the simplest solution would be to make the first instruction in the workbook open event procedure.
If the two code blocks operate on different sheets then either use the .Activate instruction to activate the relevant sheet before its code runs, or preferably since it's a better practice fully qualify the Range("B" & r)...instruction with the sheet name. the easiest way to do this is to top and tail yourf code with a 'WITH' and 'END WITH' instruction. e.g
Bookmarks