S
Sue
Hello. Select Case Statements confuse me.
The scenario - In MS Word, I have a UserForm with a listing of choices
(AutoText) using OptionButtons. The choice will be inserted at a
bookmark (which I can do outside of the Case statements)
I know it would be much more efficient to write the below as a Select
Case Statement. (There's 44 options.) Can someone get me started?
If UserForm1.OptionButton1.Value = True Then
With ActiveDocument
.AttachedTemplate.AutoTextEntries("atAtlanta").Insert
Where:=.Bookmarks("bmAddressBlock").Range, RichText:=True
UserForm1.Hide
UserForm2.Show
End With
ElseIf UserForm1.OptionButton2.Value = True Then
With ActiveDocument
.AttachedTemplate.AutoTextEntries("atBellevue").Insert
Where:=.Bookmarks("bmAddressBlock").Range, RichText:=True
UserForm1.Hide
UserForm2.Show
End With
End If
Thanks so much.
Sue Hunter
The scenario - In MS Word, I have a UserForm with a listing of choices
(AutoText) using OptionButtons. The choice will be inserted at a
bookmark (which I can do outside of the Case statements)
I know it would be much more efficient to write the below as a Select
Case Statement. (There's 44 options.) Can someone get me started?
If UserForm1.OptionButton1.Value = True Then
With ActiveDocument
.AttachedTemplate.AutoTextEntries("atAtlanta").Insert
Where:=.Bookmarks("bmAddressBlock").Range, RichText:=True
UserForm1.Hide
UserForm2.Show
End With
ElseIf UserForm1.OptionButton2.Value = True Then
With ActiveDocument
.AttachedTemplate.AutoTextEntries("atBellevue").Insert
Where:=.Bookmarks("bmAddressBlock").Range, RichText:=True
UserForm1.Hide
UserForm2.Show
End With
End If
Thanks so much.
Sue Hunter