+ Reply to Thread
Results 1 to 2 of 2

How to paste copied row from anther sheet as values.

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2018
    Location
    INDIA
    MS-Off Ver
    2016
    Posts
    6

    Post How to paste copied row from anther sheet as values.

    I am working on a code, wherein i need to copy specific row from another sheet and need to paste into row which is next to last filled row but paste as values.
    highlighted line is showing error.

      A = Worksheets("PROJECT_DETAILS").Cells(Rows.Count, 1).End(xlUp).Row
        For Z = 4 To A
        s = Worksheets("PROJECT_DETAILS").Cells(Z, 1).Value
        Sheets(s).Select
        
        A = Worksheets(s).Cells(Rows.Count, 1).End(xlUp).Row
        For i = 5 To A
            c = Worksheets("TASK_DETAILS_MAIN").Cells(Rows.Count, 1).End(xlUp).Row
            Worksheets(s).Rows(i).Copy
            Worksheets("TASK_DETAILS_MAIN").Select
            Worksheets("TASK_DETAILS_MAIN").Cells(c + 1, 1).Select
            ActiveSheet.PasteSpecial xlPasteValues
            Columns("A:I").Select
            Selection.EntireColumn.AutoFit
        Next i
        Next Z
        Worksheets("TASK_DETAILS_MAIN").Select

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How to paste copied row from anther sheet as values.

        Dim ws As Worksheet, Z As Long
        
        With Worksheets("TASK_DETAILS_MAIN")
        
            For Z = 4 To Worksheets("PROJECT_DETAILS").Cells(Rows.Count, 1).End(xlUp).Row
                Set ws = Sheets(Worksheets("PROJECT_DETAILS").Cells(Z, 1).Value)
                ws.Rows("5:" & ws.Cells(Rows.Count, 1).End(xlUp).Row).Copy
                .Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial xlPasteValues
            Next Z
            
            Application.CutCopyMode = False
            .Select
            .Columns("A:I").EntireColumn.AutoFit
        End With
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. [SOLVED] Find last used row in a range, paste it 1 row down, paste copied row as values
    By ExcelEnthusiast7 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-20-2018, 05:33 PM
  2. [SOLVED] Looking up values based on multiple conditions then put sum the values in anther sheet.
    By cuchi33 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-05-2017, 11:35 AM
  3. [SOLVED] Copy Row---> Add New Sheet----> Paste Copied Row
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2014, 05:21 PM
  4. Replies: 0
    Last Post: 05-16-2014, 05:54 AM
  5. [SOLVED] Paste previously copied values as 123 except last one and...
    By intex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-30-2014, 04:45 PM
  6. Replies: 3
    Last Post: 01-11-2012, 02:04 PM
  7. [SOLVED] copied formulas paste as values
    By Trev in forum Excel General
    Replies: 2
    Last Post: 02-11-2006, 01:15 AM

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