Step through the following macro with F8 on the keyboard observing the active sheet as you go.
Code:
Sub blah3()
Set rngA = Range("B2:F8")
Set rngB = Range("E6:I12")
rngA.Select
rngA.BorderAround 1
rngB.Select
rngB.BorderAround 1
Intersect(rngA, rngB).Select
Intersect(rngA, rngB).Interior.Color = rgbLightGrey
Range("B2").Select
End Sub
It's the same as doing the following but record a macro while you: select both the sheets' tabs (use the
Shift key to help with that as, you do with cells)
Right-click one of the selected sheet tabs and choose
Move or Copy, then in the
To book: dropdown field choose
(new book), then tick the
Create a copy tick box, click
OK. Stop recording and examine the code.
Copying sheets copies pretty much everything. By copying both sheets at once it looks like they keep their interrelationship.
It puts the two strings (sheet names) into an array in memory and is one way the code wants to see multiple sheets referred to:
Attachment 28052
Because I don't put
Option Explicit at the top of the code-module; lazy.
You've already done so merely by replying. I try to remember not to help again when people just run off with a solution without giving any sort of feedback (on some forums it could just be marking the thread as 'Solved').