Copy data and Paste
Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Copy data and Paste

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have data in Sheet1 Range A1 ,C1,D1,H1 ,and I want copy that Cells to Sheet2 Range E1,F1,H1,Z1 by Sequently (I mean A1 -> E1 ,C1->F1 ......and use For ...next Command .Thanks

  2. #2
    BatCoder
    Join Date
    Feb 2002
    Location
    Turkey
    Posts
    799
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try something like this:


    Private Sub Transfer()
    Dim a(4, 2) As Integer
    a(1, 1) = 1: a(1, 2) = 5
    a(2, 1) = 3: a(2, 2) = 6
    a(3, 1) = 4: a(3, 2) = 8
    a(4, 1) = 8: a(4, 2) = 26


    For i = 1 To 4
    Sheet2.Cells(1, a(i, 2)).Value = Sheet1.Cells(1, a(i, 1)).Value
    Next i
    End Sub


    hope this helps
    suat

  3. #3
    BatCoder
    Join Date
    Feb 2002
    Location
    Turkey
    Posts
    799
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    sorry, "a" array keeps column numbers as you can see. second paramater stands for sheet number and first parameter is column reference as integer.

    a(x, 1) means Sheet1's x. column
    a(x, 2) means Sheet2's x. column

    suat

    [ This Message was edited by: smozgur on 2002-03-15 09:48 ]

    [ This Message was edited by: smozgur on 2002-03-15 09:48 ]

    [ This Message was edited by: smozgur on 2002-03-15 09:48 ]

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks a lot ...Suat

  5. #5
    BatCoder
    Join Date
    Feb 2002
    Location
    Turkey
    Posts
    799
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    you're welcome Wichien.

    suat

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com