check 2 cells if its the same delete row + copy macro

Ynss

New Member
Joined
Feb 24, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
hello everyone
since I'm new to vba, I have small problem, I want a macro that checks 2 cells (in 2 different sheets) if they are the same delete the row of the 1st cell.
also a macro if a column has "yes" then copy it , the problem when adding a new row with yes the macro copy every row from the top , but i want to add just the new row
this my code for the second macro
VBA Code:
Dim wk As Workbook
'Dim ws_panne As Worksheet
'Dim ws_analyse As Worksheet
Dim lstrw_histopanne, lstrw_histoanalyse As Long
Dim ligne_coller As Long
 
Set wk_fichier = ActiveWorkbook
Set ws_panne = wk.Sheets("Sheet2") 
Set ws_analyse = wk.Sheets("sheet3")
  
lstrw_histopanne = .Cells(Rows.Count, 1).End(xlUp).Row

For i = 7 To lstrw_histopanne
   
    If ws_panne.Cells(i, 8) = "YES" Then
 
 lstrw_histoanalyse = ws_analyse.Cells(Rows.Count, 1).End(xlUp).Row

         row_paste  = lstrw_histoanalyse + 1
           'paste
        ws_analyse.Cells(row_paste, 1) = ws_panne.Cells(i, 5)

    End If
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top