0
Thanks

A few words of thanks would be greatly appreciated.

Excel - Copy and paste values from specific columns




Issue


I want to, copy/paste values on the specific column based on cell A2. i.e.
  • If cell A2= 1 then copy/paste values for the January column (range B2:B10).
  • If A2 = 2 then copy/paste values for column February range C2:C10, the report will change every month. i.e. the range will change accordingly to the value on cell A2.

Solution


You can define your range as:
  • Range(cells(2, (range("A2").value + 1)), cells(10, (range("A2").value + 1)))

Note that


Thanks to rizvisa1 for this tip on the forum.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team

Published by . Latest update on by aakai1056.

This document, titled "Excel - Copy and paste values from specific columns," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments