Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 41

Thread: Loop - copy & paste
Thanks Thanks: 0 Likes Likes: 0

  1. #11
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Thanks flluff Sir ji

    I want to do it through loop

    Because data is large

    And using the loop excel is not hang or we dont need to restart the excel

  2. #12
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    27,963
    Post Thanks / Like
    Mentioned
    467 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Loop - copy & paste

    Looping is slower & will probably cause more problems.
    If you have lots of formula, try
    Code:
    Sub Vishaal()
       Application.Calculation = xlCalculationManual
       Range("B12:AY24").Value = Range("A12:A24").Value
       Application.Calculation = xlCalculationAutomatic
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #13
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Ok Fluff Sir Ji

    I will try the given formula

  4. #14
    Board Regular
    Join Date
    Mar 2015
    Location
    Syria
    Posts
    240
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by Vishaal View Post
    In this code

    Can we paste values instead of formula

    It is possible

    Code:
    Sub copy_formula()Application.ScreenUpdating = False
        With ActiveSheet
        Set Rng = Range("a12:a24")
       Rng.copy
            For i = 2 To 50
               .Cells(12, i).PasteSpecial Paste:=xlPasteFormulas
            Next
     With Range("b12:ay24")
        .Value = .Value
        End With
        End With
       Application.ScreenUpdating = True
    End Sub
    Last edited by mohadin; Aug 31st, 2019 at 08:49 AM.

  5. #15
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by footoo View Post
    Code:
    [A12:A24].Copy [B12:AY24]

    Pls provide the complete vba code

  6. #16
    Board Regular
    Join Date
    Sep 2016
    Posts
    2,571
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by Vishaal View Post
    Pls provide the complete vba code
    It is complete.

  7. #17
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by Fluff View Post
    For values only use
    Code:
    Sub Vishaal()
       Range("B12:AY24").Value = Range("A12:A24").Value
    End Sub


    I have just used it

    U r right

    Its really fast

    But problem is its providing the value of A12:A24 in all
    Instead of different values for B12, C12,D12

  8. #18
    Board Regular
    Join Date
    Mar 2015
    Location
    Syria
    Posts
    240
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by Vishaal View Post
    Pls provide the complete vba code
    you still cal add to below
    Code:
     Sub copy_formula()
    [A12:A24].copy [B12:AY24]
        With Range("b12:ay24")
            
            .Value = .Value
        End With
    End Sub
    Last edited by mohadin; Aug 31st, 2019 at 08:56 AM.

  9. #19
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Pls elaborate, unable to understand

    I am not a professional vba developer

    Pls add this with previous code, pls pls

    Thanks again for your help

  10. #20
    Board Regular
    Join Date
    Mar 2019
    Posts
    193
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Loop - copy & paste

    Quote Originally Posted by Vishaal View Post
    Pls provide the complete vba code


    In which coloumn or row we need to put this code

    Pls

Some videos you may like

User Tag List

Tags for this Thread

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
  •