![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
![]() Yes, I did. Still couldn't apply the code to an event. I guess I need more assistance. It isn't coming to me. Thanks, |
#2
|
|||
|
|||
![]()
This is the code I am trying. When I saved the file (.docm) it didn't work. What am I doing wrong? Please! Thanks!
Private Sub oApp_DocumentBeforeSave(ByVal Doc As Document, _ SaveAsUI As Boolean, Cancel As Boolean) Sub DelRows() Application.ScreenUpdating = False Dim r As Long With ActiveDocument.Tables(1) For r = .Rows.Count To 1 Step -1 With .Rows(r) If .Range.Fields.Count > 0 Then .Delete End With Next End With Application.ScreenUpdating = True End Sub Last edited by aaghd72; 02-15-2019 at 10:47 AM. Reason: Added Document |
![]() |
Tags |
delete, macro, rows |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
MathiasFC | Word VBA | 2 | 02-10-2019 04:06 PM |
![]() |
cltay87 | Word VBA | 4 | 02-27-2017 04:23 AM |
![]() |
braddgood | Word VBA | 15 | 10-02-2015 01:54 PM |
![]() |
Bathroth | Word VBA | 1 | 10-01-2014 01:40 PM |
![]() |
ubns | Excel Programming | 2 | 08-14-2012 02:01 AM |