tags:

views:

14

answers:

1

Hi, I'm new to macro programming in VB, and what I'm trying to do is clone a row in my word document when a button is clicked. I've made an attempt as shown in the picture below. What do I need to do to make the addTwoDependants() subroutine run when the button is clicked?

+1  A: 
public sub cloneDependants_Click()
   call addTwoDependants
end sub

Your code should work as well.
Are you getting any error? If so, post a comment to this answer or edit your question to mention that.

EDIT: Looking at the screenshot, you have added the code for addTwoDependants under a document named Normal. To fix this, add a module under the document which has the button (Fna) and move the above code in the newly added bas module.

shahkalpesh
Compile Error: Sub or function not defined.
Atomix