+ Reply to Thread
Results 1 to 13 of 13

Please modify my VBA, I want copy paste in next sheet

Hybrid View

vengatvj Please modify my VBA, I want... 11-14-2013, 02:11 PM
Mumps1 Re: Please modify my VBA, I... 11-14-2013, 02:24 PM
Solus Rankin Re: Please modify my VBA, I... 11-14-2013, 02:29 PM
vengatvj Re: Please modify my VBA, I... 11-14-2013, 02:36 PM
mehmetcik Re: Please modify my VBA, I... 11-14-2013, 02:30 PM
mehmetcik Re: Please modify my VBA, I... 11-14-2013, 02:36 PM
vengatvj Re: Please modify my VBA, I... 11-14-2013, 02:38 PM
JOHN H. DAVIS Re: Please modify my VBA, I... 11-14-2013, 04:50 PM
vengatvj Re: Please modify my VBA, I... 11-15-2013, 10:15 AM
Mumps1 Re: Please modify my VBA, I... 11-15-2013, 10:35 AM
AB33 Re: Please modify my VBA, I... 11-15-2013, 10:37 AM
vengatvj Re: Please modify my VBA, I... 11-15-2013, 12:05 PM
Mumps1 Re: Please modify my VBA, I... 11-15-2013, 04:56 PM
  1. #1
    Forum Contributor
    Join Date
    09-19-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    252

    Please modify my VBA, I want copy paste in next sheet

    Hi,
    I want copy A to I column data, and I need to paste in second sheet. I tried in macro recording, but my problem is my VBA only copy "A1:I10" Data,

    Some times I need to copy more data, But my vba only copy first 10 cell data only. how to modify this vba?

    Sub love()
    '
    ' love Macro
    '
    
    '
        Range(Selection, Selection.End(xlDown)).Select
        Range("A1:I10").Select
        Selection.Copy
        ActiveSheet.Next.Select
        ActiveSheet.Paste
        Range("A1").Select
    End Sub

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: Please modify my VBA, I want copy paste in next sheet

    Your current code copies A1:I10 and then pastes it. What is the exact range you want to copy and where in the second sheet do you want to copy it to?

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Please modify my VBA, I want copy paste in next sheet

    Like this?
    Sub love()
    Range("A1:I" & Range("I" & Rows.Count).End(xlUp).Row).Copy Destination:=Sheets(ActiveSheet.Index + 1).Range("A1")
    End Sub
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Forum Contributor
    Join Date
    09-19-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    252

    Re: Please modify my VBA, I want copy paste in next sheet

    Solus Rankin, your code copy only first 8 cells, see my sample excel
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Please modify my VBA, I want copy paste in next sheet

    This should work

    Sub love()
    '
    ' love Macro
    '
     Columns("A:I").Select
        Selection.Copy
        ActiveSheet.Next.Select
        ActiveSheet.Paste
        Range("A1").Select
    End Sub
    This should also work

    
    
    
    Sub love()
    '
    ' love Macro
    '
     Columns("A:I").Copy
        ActiveSheet.Next.Select
        ActiveSheet.Paste
        Range("A1").Select
    End Sub

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Please modify my VBA, I want copy paste in next sheet

    This should work

    Sub love()
    '
    ' love Macro
    '
     Columns("A:I").Select
        Selection.Copy
        ActiveSheet.Next.Select
        ActiveSheet.Paste
        Range("A1").Select
    End Sub
    This should also work

    [CODE]

    Sub love()
    Sub love()
     Columns("A:I").Copy
        ActiveSheet.Next.Select
        Range("A1").Select
        ActiveSheet.Paste
        Range("A1").Select
    End Sub

  7. #7
    Forum Contributor
    Join Date
    09-19-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    252

    Re: Please modify my VBA, I want copy paste in next sheet

    Hi all, see my sample file, some time my data will be more than 100 data, i give just 10 data in sample file. please., see and tell me the solution,
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Please modify my VBA, I want copy paste in next sheet

    Maybe:

    Sub vengatvj()
    Sheets("Sheet1").UsedRange.Copy ActiveSheet.Next.Range("A" & Rows.count).End(3)(2)
    End Sub

  9. #9
    Forum Contributor
    Join Date
    09-19-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    252

    Re: Please modify my VBA, I want copy paste in next sheet

    Hi John H.DAVIS, your formula copying whole row data to next sheet. I want copy only A TO I column data and count may be variable in any time. kindly make it only copy A to I data

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: Please modify my VBA, I want copy paste in next sheet

    Try:
    Sub CopyData()
        Application.ScreenUpdating = False
        Dim bottomA As Integer
        bottomA = Range("A" & Rows.Count).End(xlUp).Row
        Sheets("Sheet1").Range("A1:I" & bottomA).Copy Sheets("Sheet2").Range("A1")
        Application.ScreenUpdating = True
    End Sub
    Last edited by Mumps1; 11-15-2013 at 10:40 AM.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Please modify my VBA, I want copy paste in next sheet

    Another one

    Option Explicit
    
    Sub copyme()
    Dim LR&, ms As Worksheet
    Application.ScreenUpdating = 0
    Set ms = Sheets("Sheet2")
     With Sheets("Sheet1")
        LR = .Cells.Find("*", , , , xlByRows, xlPrevious).Row
       .Range("A1:I" & LR).Copy
       ms.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlValues
     End With
     Application.CutCopyMode = 0
    Application.ScreenUpdating = True
    End Sub

  12. #12
    Forum Contributor
    Join Date
    09-19-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    252

    Re: Please modify my VBA, I want copy paste in next sheet

    Very thank to Mumps1, AB33. Your Program working well. Thank you so much again...

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: Please modify my VBA, I want copy paste in next sheet

    Glad it worked out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Modify copy & paste code with sorting from A-Z
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2013, 10:49 AM
  2. [SOLVED] Please help me to modify the code copy/paste/transpose
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2013, 09:44 AM
  3. I created a cut & past VBA and trying to modify it for copy and paste
    By vademo0o in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 10:14 AM
  4. How can I copy the data of sheet 1 to sheet 2 with modify?
    By accessman2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2005, 04:05 AM
  5. Replies: 1
    Last Post: 01-04-2005, 06:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1