D
DGjr.
Hi. I'm trying to find/write vba script that will hide only a select number
of rows from a table - so that I deselect a checkbox and it hides say, 10
rows below it. I've found the following code, but it hides ALL rows
underneath it. I only want some. Can someone help me?
Private Sub CheckBox1_Change()
Call ShowHideTable
End Sub
Sub ShowHideTable()
With Selection
.GoTo What:=wdGoToTable, Which:=wdGoToNext, _
Count:=1, Name:=""
.Tables(1).Select
End With
If CheckBox1.Value = True Then
With Selection.Font
.Hidden = False
End With
With ActiveWindow.View
.ShowHiddenText = True
.ShowAll = True
End With
Else
With Selection.Font
.Hidden = True
End With
With ActiveWindow.View
.ShowHiddenText = False
.ShowAll = False
End With
With Selection
.Collapse direction:=wdCollapseStart
.MoveLeft unit:=wdCharacter, Count:=1
End With
End If
End Sub
of rows from a table - so that I deselect a checkbox and it hides say, 10
rows below it. I've found the following code, but it hides ALL rows
underneath it. I only want some. Can someone help me?
Private Sub CheckBox1_Change()
Call ShowHideTable
End Sub
Sub ShowHideTable()
With Selection
.GoTo What:=wdGoToTable, Which:=wdGoToNext, _
Count:=1, Name:=""
.Tables(1).Select
End With
If CheckBox1.Value = True Then
With Selection.Font
.Hidden = False
End With
With ActiveWindow.View
.ShowHiddenText = True
.ShowAll = True
End With
Else
With Selection.Font
.Hidden = True
End With
With ActiveWindow.View
.ShowHiddenText = False
.ShowAll = False
End With
With Selection
.Collapse direction:=wdCollapseStart
.MoveLeft unit:=wdCharacter, Count:=1
End With
End If
End Sub