View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Copy columns and paste with blank column between

Well, at least my thought process was heading in the right direction
now that I see these workable samples.

I knew I would need a variable to determine the number of columns on
sheet 1 which I can do well enough and a method to advance the copied
columns to sheet 2by two. I didn't know what that was going to look
like. Not so bad seeing it properly written, and I can read it
pretty well. Composing is another thing.

And I'm getting more adept at using this method as you suggest,
Garry. Although here you are using .Value on target and source.
Don't you set both target and source to ranges? Probably confusing
what you are trying to convey.


This assumes the variables have been defined/set prior to usage. Given
the amount of programming you do.., I didn't think this needed
explaining!

rngTarget.Value = rngSource.Value



I'm missing your point on the InputBox suggestion for

<When your source/target ranges vary

When you prompt for a destination range, isn't the "uppermost left
cell" really all you need, ranges same or different?


True for a copy/paste! It's required that the target range is resized
to match the source range when directly assigning values in this
fashion. Note that this is faster because there's no background
calculation done for the target range size.

Thanks to both of you for the info.

Howard


--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com