LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Placement of code

To what extent does it matter where my code is? That is, whether the
code sits behind a worksheet, or in a module, or behind a userform?

I assume that if I have controls on different objects with the same
name, the code behind that object will control it. For example, if I
have a "Show Instructions" button on a worksheet and a userform, both
with the name ShowInstructions, then the ShowInstructions_Click() event
behind the worksheet and the form will each respond to the button on
the worksheet or form.

But what about code in a module? Does VBA care if its in a module or a
worksheet? Does it share values in a given object but not between
objects? What exactly do the "public" and "private" statements do in
regard to variables, and to objects and events? In the programming I
have done, I've often been casual or careless about this stuff, and
have usually been able to get it to work, but I'd like to understand
better and make my programs better and cleaner, as well as more
functional.

Thanks in advance.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Name Placement lsmft Excel Discussion (Misc queries) 7 March 2nd 06 12:16 AM
Tab placement Spiff Excel Discussion (Misc queries) 1 September 15th 05 02:04 PM
Custom button, code placement el_peacock Excel Programming 2 December 13th 04 04:30 PM
Placement of Code Phil Hageman[_3_] Excel Programming 7 January 30th 04 02:06 PM
Bar placement Beto[_3_] Excel Programming 2 January 15th 04 05:15 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"