+ Reply to Thread
Results 1 to 3 of 3

Help on Pasting Values

Hybrid View

2001jesper Help on Pasting Values 05-21-2013, 08:34 AM
ragulduy Re: Help on Pasting Values 05-21-2013, 08:43 AM
2001jesper Re: Help on Pasting Values 05-21-2013, 11:40 AM
  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    61

    Help on Pasting Values

    Hi All
    Can anybody help me make my code paste values - have tried to PasteSpecial Paste:=xlPasteValues but cant seem to make it work

    Sub CopyDataFromSheet()
    
    Worksheets("Spend development on Categories").Activate
    
    x = 52
    
    Do While Cells(x, 1) <> ""
    
    If Cells(x, 1) >= 1 Then
    Worksheets("Spend development on Categories").Rows(x).Copy
    Worksheets("Category-Change").Activate
    Erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    ActiveSheet.Paste Destination:=Worksheets("Category-Change").Rows(Erow)
    End If
    Worksheets("Spend development on Categories").Activate
    x = x + 1
    Loop
    
    End Sub
    Thx in advance
    Last edited by 2001jesper; 05-21-2013 at 11:39 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Help on Pasting Values

    Sub CopyDataFromSheet()
    
    Worksheets("Spend development on Categories").Activate
    
    x = 52
    
    Do While Cells(x, 1) <> ""
    
    If Cells(x, 1) >= 1 Then
    Worksheets("Spend development on Categories").Rows(x).Copy
    Worksheets("Category-Change").Activate
    Erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Worksheets("Category-Change").Rows(Erow).PasteSpecial xlValues
    End If
    Worksheets("Spend development on Categories").Activate
    x = x + 1
    Loop
    
    End Sub

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help on Pasting Values

    Thank you so much, it worked perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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