Hi,
I am trying to build a script to copy columns of sheet1 which contain particular column headers to sheet2 in a workbook. Please help me out on this.
Thanks in advance.
Hi,
I am trying to build a script to copy columns of sheet1 which contain particular column headers to sheet2 in a workbook. Please help me out on this.
Thanks in advance.
dhiraj.ch185,
It would help if we had your workbook, and detailed instructions on your requirements.
To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
Have a great day,
Stan
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vOQApTgb
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vbihZ-7W
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vfmpSO0F
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vjfTJ7lX
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vmq-LHHz
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vst3j_7i
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwBqjIR5Nj
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwBw8El0r5
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwC63GbRuM
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwC9fyKZdo
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwCEn8DBQe
https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bw0Bey8gQO
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
Last edited by DocAElstein; 09-22-2023 at 05:35 PM.
Below is an example - you just have to set the variables ahead of time - if you want to also change workbook just specify that ahead of the worksheet name(s)
If by selected values you mean cells highlighted (by the mosue) in your sheet then use the selection property - I am not sure exactly what you meanCode:SourceRangeVal = Split(Cells(1, ColumnFirst).Address, "$")(1) & FirstRecord & ":" & Split(Cells(1, ColumnLast).Address, "$")(1) & LastRecord DistinationRangeVal = Split(Cells(1, ColumnFirst).Address, "$")(1) & FirstRecord & ":" & Split(Cells(1, ColumnLast).Address, "$")(1) & LastRecord Worksheets("Sheet1").Range(SourceRangeVal).Copy Destination:=Worksheets("Sheet2").Range(DistinationRangeVal)
Last edited by Rasm; 02-02-2012 at 06:27 AM.
xl2007 - Windows 7
xl hates the 255 number
Bookmarks