Isaac
Lifelong Learner
- Local time
- Today, 11:46
- Joined
- Mar 14, 2017
- Messages
- 11,013
So in my everlasting efforts to avoid any Excel VBA which is like activating, selecting, or having something 'active'/'focused' before an action takes place.........Or even doing something that smells remotely similar.......I've always enjoyed using Range.Copy [Destination].
Common code for me is this:
I love the one liner, and I also like that some of the "gotchas" that accompany Worksheet/Range.Paste aren't there with this method.
But what are the formatting ramifications of this?
Specifically: Right now we have a destination range that is General, and we want to preserve that. Most people would just set aside my approach and use Range.PasteSpecial > Values, so as not to affect the destination's formatting. Must I do the same?
Common code for me is this:
Code:
Set rngCopy = wsImport.Range("A2:FD" & lastrowAfterDupCheck)
Set rngPaste = wsSnap.Range("A2")
rngCopy.Copy rngPaste
Set rngPaste = wsLocal.Range("A2")
rngCopy.Copy rngPaste
I love the one liner, and I also like that some of the "gotchas" that accompany Worksheet/Range.Paste aren't there with this method.
But what are the formatting ramifications of this?
Specifically: Right now we have a destination range that is General, and we want to preserve that. Most people would just set aside my approach and use Range.PasteSpecial > Values, so as not to affect the destination's formatting. Must I do the same?