Results 1 to 3 of 3

Thread: Copy selected data to other excel sheet

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    14
    Rep Power
    0

    Question Copy selected data to other excel sheet

    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.

  2. #2
    Junior Member
    Join Date
    May 2011
    Posts
    10
    Rep Power
    0
    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.

  3. #3
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    13
    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)


    Code:
    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)
    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 mean
    Last edited by Rasm; 02-02-2012 at 06:27 AM.
    xl2007 - Windows 7
    xl hates the 255 number

Similar Threads

  1. Replies: 1
    Last Post: 05-19-2013, 02:37 PM
  2. Replies: 3
    Last Post: 05-14-2013, 03:25 PM
  3. Replies: 1
    Last Post: 02-10-2013, 06:21 PM
  4. Replies: 2
    Last Post: 12-26-2012, 08:31 AM
  5. Replies: 2
    Last Post: 04-08-2012, 09:42 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •