filmov
tv
Excel VBA Macro: Delete Rows (Based on List of Values)
Показать описание
Excel VBA Macro: Delete Rows (Based on List of Values)
Code:
Sub delete_rows_based_on_list()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim row_count1 As Long
Dim row_count2 As Long
Dim i As Long
Dim j As Long
Set ws1 = ThisWorkbook.Sheets("Stock Screener")
Set ws2 = ThisWorkbook.Sheets("Items to Delete")
ws2.Activate
row_count2 = ws2.Cells(Rows.Count, "A").End(xlUp).Row
ws1.Activate
row_count1 = ws1.Cells(Rows.Count, "A").End(xlUp).Row
For j = 1 To row_count2
i = 2
Do While i <= row_count1
If Cells(i, 10) = ws2.Cells(j, 1).Text Then
Rows(i).EntireRow.Delete
i = i - 1
row_count1 = row_count1 - 1
End If
i = i + 1
Loop
Next j
End Sub
#excelmacro #excelvba
Code:
Sub delete_rows_based_on_list()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim row_count1 As Long
Dim row_count2 As Long
Dim i As Long
Dim j As Long
Set ws1 = ThisWorkbook.Sheets("Stock Screener")
Set ws2 = ThisWorkbook.Sheets("Items to Delete")
ws2.Activate
row_count2 = ws2.Cells(Rows.Count, "A").End(xlUp).Row
ws1.Activate
row_count1 = ws1.Cells(Rows.Count, "A").End(xlUp).Row
For j = 1 To row_count2
i = 2
Do While i <= row_count1
If Cells(i, 10) = ws2.Cells(j, 1).Text Then
Rows(i).EntireRow.Delete
i = i - 1
row_count1 = row_count1 - 1
End If
i = i + 1
Loop
Next j
End Sub
#excelmacro #excelvba
VBA Macro to Delete Rows Based on Cell Values
Excel VBA Macro: Delete Rows Based on Cell Value (Zeros and Blanks)
Delete Rows Based On Criteria Excel VBA Macro
Excel VBA Macro: Delete Rows (Based on Cell Values in Multiple Columns)
Add Buttons To Delete Rows Excel VBA Macro
Excel VBA Macro: Delete Rows Faster (Based on Cell Value)
Delete Rows based on Value/Text // Excel VBA Tutorial
Excel VBA Macro: Delete Rows if Cell Does Not Contain a Certain Text (String) Value
VBA code | How to sum column in listbox Userform Microsoft Excel VBA
Excel VBA Delete row macro
Excel VBA Macro: Delete Rows (Based on List of Values)
Delete Blank Rows Excel VBA Macro
Excel VBA to Delete Row or Column in Excel Table
How to use VBA in Excel to Delete Rows with Some Value
VBA Macro Code to Delete Rows Based on Cell Values
Excel VBA macro to delete rows based on cells value
Excel VBA - Rows and Columns Delete
How to Delete rows in Excel VBA using For loop
Excel VBA - Delete Cells
Excel VBA to Delete Rows if Cell is Blank - Delete Rows Based on Cell Value - Code Included
Row insert & delete | VBA tutorial | simple vba code in excel
Delete Rows And Columns - VBA Macros - Tutorial - MS Excel 2007, 2010, 2013
Deleting rows based on cell values across sheets using VBA
VBA to Delete Multiple Columns based on Headers - Excel VBA Macro Example
Комментарии