Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimize Code?

Status
Not open for further replies.

supernewb

Technical User
Feb 7, 2005
18
US
hi all,
i'm running out of ideas. i now have two user forms (word2000)and they are huge & i will take the blame for some of this :O . both were getting "not enough memory errors" when i ran them- but i was able to optimize the first form and now it runs without errors. this is some code from the second form. one of the issues is that on several of these, the move down count on the third line is different (they are mostly 1, 2, and 4)
AND some of the numbering is unfortunatly not sequential. i know in excel, i can remove "selection", but it won't let me in word. is there any way to shrink this down a bit??

Code:
If CheckBox_p3a11.Value = False Then
Selection.GoTo what:=wdGoToBookmark, Name:="p3a11"
Selection.MoveDown Unit:=wdParagraph, Count:=2, Extend:=wdExtend
Selection.delete Unit:=wdCharacter, Count:=1
End If

If CheckBox_p3a12.Value = False Then
Selection.GoTo what:=wdGoToBookmark, Name:="p3a12"
Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.delete Unit:=wdCharacter, Count:=1
End If
any help much appreciated!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top