Results 1 to 6 of 6

Thread: code not to copy formula

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    18
    Rep Power
    0
    Hi Peter,

    Try this which copies the range from SHEET2 to Sheet3 as values:

    Code:
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        Dim ws1 As Worksheet
        Dim ws2 As Worksheet
        Dim tRow As Long
        Dim nRow As Long
        
        If Target.Cells.Count > 1 Then Exit Sub
        If Not Intersect(Target, Range("M:M")) Is Nothing Then                  'adjust for check column
            If UCase(Target.Value) = "Y" Then
                Set ws1 = Worksheets("SHEET2")
                Set ws2 = Worksheets("Sheet3")
                tRow = Target.Row
                nRow = ws2.Cells(Rows.Count, 1).End(xlUp).Row + 1
                Application.ScreenUpdating = False
                ws1.Range("A" & tRow).Resize(, 9).Copy
                ws2.Range("A" & nRow).PasteSpecial xlPasteValues    '(, 8) adjust for # columns to copy
                Application.CutCopyMode = False
                Set ws1 = Nothing
                Set ws2 = Nothing
                Application.ScreenUpdating = True
            End If
        End If
    
    End Sub
    HTH

    Robert

  2. #2
    Member
    Join Date
    May 2013
    Posts
    84
    Rep Power
    13
    Thanks Robert that works great..

    Is there a way to get it so that when i put a cost in the ist service cell and copy it copies to sheet 3 and then when i enter a cost in 2nd service it will add this data or copy over the same row uning the reg as a unique number

    peter

Similar Threads

  1. VBA Code To Autofill Formula In Every Nth Row
    By analyst in forum Excel Help
    Replies: 1
    Last Post: 12-23-2013, 05:51 PM
  2. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  3. Replies: 1
    Last Post: 10-16-2013, 05:06 PM
  4. VBA Code to Open Workbook and copy data
    By Howardc in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 06:58 PM
  5. VBA code to copy data from source workbook
    By Howardc in forum Excel Help
    Replies: 1
    Last Post: 07-30-2012, 09:28 AM

Posting Permissions

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