Consulting

Results 1 to 3 of 3

Thread: I Need help edit code copy and past

  1. #1

    I Need help edit code copy and past



    Hi
    I have code work very good copy from cell to another cell but i need edit it
    If in cell G number not past agian new number from cell A

    Private Sub Worksheet_Calculate()
    Dim c As Range
    Application.EnableEvents = False
            On Error Resume Next
    For Each c In Range("E7:E" & Cells(Rows.Count, "E").End(xlUp).Row)
            If c = "Yes" Then
                With c
                    .Offset(, 1).Value = "Yes"
                    .Offset(, 2).Value = .Offset(, -4).Value
                End With
            End If
        Next c
    Application.EnableEvents = True
    End Sub

    Please help me
    Attached Files Attached Files

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    [VBA]Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E7:E" & Cells(Rows.Count, "E").End(xlUp).Row)) Is Nothing Then
    If Target = "Yes" Or Target = "yes" Then
    With Target
    .Offset(, 1).Value = "Yes"
    .Offset(, 2).Value = .Offset(, -4).Value
    End With
    End If
    End If
    End Sub[/VBA]

  3. #3

    Smile

    Quote Originally Posted by patel
    [vba]Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E7:E" & Cells(Rows.Count, "E").End(xlUp).Row)) Is Nothing Then
    If Target = "Yes" Or Target = "yes" Then
    With Target
    .Offset(, 1).Value = "Yes"
    .Offset(, 2).Value = .Offset(, -4).Value
    End With
    End If
    End If
    End Sub[/vba]
    Thank you

Posting Permissions

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