Results 1 to 5 of 5

Paste the values

Threaded View

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    UAE
    MS-Off Ver
    Excel 2016,office 365
    Posts
    69

    Post Paste the values

    Dear Experts
    How can I change the code for copy or paste the values only from the below code
    Sub Test()
    Dim N As Long
    Dim M As Long

    Sheets("Manpower").Activate
    Sheets("Sheet1").Cells.ClearContents
    Range(Cells(2, 2), Cells(2, 17)).Copy Destination:=Sheets("Sheet1").Cells(2, 1)
    Sheets("Sheet1").Cells(2, 15) = "Contract code"
    Sheets("Sheet1").Cells(2, 16) = "Percentage"

    For N = 3 To Cells(Rows.Count, 1).End(xlUp).Row
    If Cells(N, 1).Value = "" Then Exit For
    For M = 17 To Cells(3, Columns.Count).End(xlToLeft).Column
    If Cells(N, M) <> "" Then
    Range(Cells(N, 2), Cells(N, 15)).Copy Destination:=Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(0, 14) = Cells(2, M)
    Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(0, 15) = Cells(N, M)
    End If
    Next M
    Next N
    End Sub
    Last edited by krishnakuma6; 01-31-2015 at 01:26 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 11-29-2014, 01:14 PM
  2. copy formula and paste for new data added and autofill.....and paste special values
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2014, 07:40 AM
  3. Replies: 1
    Last Post: 12-05-2012, 11:37 AM
  4. [SOLVED] Excel 2002 - Can only paste values, wont let me paste special
    By MK_Chopper_P in forum Excel General
    Replies: 2
    Last Post: 07-12-2012, 02:22 AM
  5. Replies: 2
    Last Post: 04-12-2011, 09:46 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