Consulting

Results 1 to 2 of 2

Thread: Macro which copy cells if other cell have specific value

  1. #1
    VBAX Newbie
    Joined
    Sep 2014
    Posts
    1
    Location

    Macro which copy cells if other cell have specific value

    Hi guys,

    I need help with macro
    I need macro, that will be copy value from cells in column B from sheet1 to first avaible (free) cell in column D of sheet2 under condition that in cell in column F of sheet1 (in that row) is value "yes". After that i need to remove that row in sheet1. I have something like this at this moment:
    Sub ddd() 
    
    
        Dim OstW As Long 
        Dim kom As Excel.Range 
    
        Application.ScreenUpdating = False 
    
        With Sheets("Sheet1") 
            OstW = .Cells(Rows.Count, "F").End(xlUp).Row 
    
            For Each kom In .Range("F4:F" & OstW) 
                If kom.Value = "yes" Then 
                    Range("B4:B").Copy 
    
                    With Sheets("Sheet2") 
                        Range("D5:D").PasteSpecial 
                        Paste = xlPasteValues 
    
                    End With 
    
                    .Rows(kom.Row).Delete 
                End If 
            Next kom 
    
        End With 
    
        Application.ScreenUpdating = True 
    
    End Sub

    I hope you can help me.

    Please!

  2. #2

Posting Permissions

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