View Single Post
 
Old 04-13-2021, 08:06 PM
ez1138 ez1138 is offline Windows 10 Office 2019
Novice
 
Join Date: Apr 2021
Posts: 3
ez1138 is on a distinguished road
Default Multiple tables in Word, converting working Excel macro

Hi, I have multiple tables within a Word document. Below is my working Excel VBA code. How do I convert it to Word for a table name "Table_Implemented"? Also, since I use the Power Automate "Populate a Word Document", is there a way to run the macro automatically once the document is created?

Thanks for any insight!!!

Code:
Sub deleteRow()
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = False

'declare variables
Dim deleteRow As Long
Dim ws As Worksheet

'set objects
Set ws = ActiveSheet

For deleteRow = ws.Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1

If ws.Range("A" & deleteRow).Value = "Not Implemented" Then
Rows(deleteRow).EntireRow.Delete
End If

Next deleteRow

Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True

Last edited by macropod; 04-13-2021 at 09:37 PM. Reason: Added code tags
Reply With Quote