In VBA for Excel, what is the difference between Sheets.Select and Sheets.Activate ?
To expand on the above: When the code below is run with Replace:=False no worksheet deactivation event occurs on sheet4. If Replace:=True is used instead then the de-activation event will fire.
Preventing the event is desirable in most circumstances as it can cause unexpected behaviour.
This means that select is only the equivalent of CTRL+Clicking a worksheet tab IF replace:=false is used.
sub a
Dim rng As Range
Sheet4.Select Replace:=False
Set rng = Selection
Sheet5.Select Replace:=True
Selection = rng.Value
end sub
Thanks for your posts as it helped me understand the difference.
Harvey