VBE - code duplication concern...

S

Steve P

Hello everyone,

I have successfully writen a data import script that appends excel data to
an exisiting table. I wrote the script to operate on the button-click event
for a command button. When navigating my code in the VBE, I notice that the
code is duplicated in different form objects, which it shouldn't be. I would
like to only view the vba code that corresponds to the form I am working
with, or intend to be working with.

Is there a view-setting in the VBE that will accomplish this?
 
P

pietlinden

Hello everyone,

I have successfully writen a data import script that appends excel data to
an exisiting table. I wrote the script to operate on the button-click event
for a command button. When navigating my code in the VBE, I notice that the
code is duplicated in different form objects, which it shouldn't be. I would
like to only view the vba code that corresponds to the form I am working
with, or intend to be working with.

Is there a view-setting in the VBE that will accomplish this?

Doesn't sound like a view-setting problem. Sounds like a coding
issue..

If you reuse the exact same chunk of code over and over, why not just
take the whole thing, put it in it's own function/sub and then include
arguments so you can call it from anywhere?
 
K

Klatuu

The only options are for the current module or the current procedure. You
can only see other modules by changing windows in the VBA editor. I don't
really know what it is you think you are seeing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top