Hi Paul
I'm afraid I'm losing my mind on this one. I tried the bookmark suggestion and your code but sadly it didn't get me to where I wanted to be. Whether that's because I'm just rubbish with bookmarks or in general I'm not sure.
I went back to the idea of coding in the delete for each page just using very basic IF statements on the basis of whether the ComboBox in the Userform is vbNullString or not:-
Dim oRng As Range
If Me.ComboBox36.Value = vbNullString ThenSet oRng = ActiveDocument.Sections(15).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox34.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(14).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox32.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(13).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox30.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(12).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox28.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(11).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox26.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(10).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox20.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(9).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox19.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(8).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox18.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(7).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox17.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(6).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox16.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(5).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
If Me.ComboBox14.Value = vbNullString Then
Set oRng = ActiveDocument.Sections(4).Range
oRng.MoveStart wdCharacter, -1
oRng.Delete
End If
Unfortunately all this seems to be doing is deleting out Sections 4 to 15 no matter what values are in the ComboBoxes. I'm stumped as I can't think of any logical reason why that would be.
Any ideas?
Thanks
Dav