Forum Discussion
Youngmrr
Nov 20, 2020Copper Contributor
Macro to copy columns if values begins specific text.
Hi everyone! I am new to Macro. I am trying to build a macro that can copy columns which text begins with specific values (e.g. ABCD) from the active worksheet, and paste into another worksheet (...
Youngmrr
Nov 21, 2020Copper Contributor
Hi, Bennadeau
Thank you for your help.
One more question for this to extend moving forward.
The macro copies only two columns.
So, can you please advise how to do if I have 10 of 'ABCD' columns (somewhere within the same row) to be looked and copied?
Many thanks for your help!
Bennadeau
Nov 21, 2020Iron Contributor
Actually, this macro looks at the first 20 columns.
Look at line 7: "For j = 1 To 20" if you want to expand or reduce, change 20 to whatever you want.
Also, the macro looks at the first 2000 rows.
Look at line 8: "For i = 1 To 2000" if you want to expand or reduce, change 2000 to whatever you want.