Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DEE DEE is offline
external usenet poster
 
Posts: 250
Default HELP! Object specific Code

Hi,

Am trying to understand VBA object code. I know that the Modules folders
contain sub routines for that workbook project.

I also noted that you can have code windows open for a particular worksheet.
When I click on the down arrow and select General, this code appears
automatically:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

What does this mean?

--
Thanks!

Dee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP! Object specific Code

It is the selectionchange event for that worksheet. It fires whenever the
user selects a cell

http://www.cpearson.com/excel/events.htm
Chip Pearson's page on events (assuming it is back up - seemed to be down
earlier)
--
Regards,
Tom Ogilvy

"dee" wrote in message
...
Hi,

Am trying to understand VBA object code. I know that the Modules folders
contain sub routines for that workbook project.

I also noted that you can have code windows open for a particular

worksheet.
When I click on the down arrow and select General, this code appears
automatically:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

What does this mean?

--
Thanks!

Dee



  #3   Report Post  
Posted to microsoft.public.excel.programming
DEE DEE is offline
external usenet poster
 
Posts: 250
Default HELP! Object specific Code

Hi Tom,

Thanks for your help! So, I can write code that is stores in the Modules
folder that makes the sub available to all sheets in that workbook only
(unless written in the Modules folder of the Personal folder), OR I can write
code that is specific to only a particular worksheet.

The code is simply stored in the workbook code window; it doesn't have a
container like modules do (being placed in a modules folder)

Are these assumptions correct?

Thanks again!

"Tom Ogilvy" wrote:

It is the selectionchange event for that worksheet. It fires whenever the
user selects a cell

http://www.cpearson.com/excel/events.htm
Chip Pearson's page on events (assuming it is back up - seemed to be down
earlier)
--
Regards,
Tom Ogilvy

"dee" wrote in message
...
Hi,

Am trying to understand VBA object code. I know that the Modules folders
contain sub routines for that workbook project.

I also noted that you can have code windows open for a particular

worksheet.
When I click on the down arrow and select General, this code appears
automatically:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

What does this mean?

--
Thanks!

Dee




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP! Object specific Code

If you do Insert=Module you will get an entry under the modules entry in
the project explorer. Code in these modules are available to all code
within that workbook as long as the module is not declared as private or an
individual procedure is declared as private (this is true whether the
workbook is the personal workbook or not -- there is nothing special about
the personal workbook with respect to this).

Each worksheet has a corresponding module. these modules are used to
support sheet level events that can be selected/declared by using the
dropdowns at the top. This code reacts to actions by the user on that
sheet. Performing the action triggers the event code.

Similar there is a workbook level module. In the project explorer it is
shown as the ThisWorkbook module. It supports code for Workbook level
events.

Unless you are writing event code, you should be working in a general
module.

There is a similar situation with a userform. A module is associated with
the userform like a module is associated with a sheet. In fact, these
associated modules are special predefined Class modules.

You may also create you own classes using class modules.

--
Regards,
Tom Ogilvy

"dee" wrote in message
...
Hi Tom,

Thanks for your help! So, I can write code that is stores in the Modules
folder that makes the sub available to all sheets in that workbook only
(unless written in the Modules folder of the Personal folder), OR I can

write
code that is specific to only a particular worksheet.

The code is simply stored in the workbook code window; it doesn't have a
container like modules do (being placed in a modules folder)

Are these assumptions correct?

Thanks again!

"Tom Ogilvy" wrote:

It is the selectionchange event for that worksheet. It fires whenever

the
user selects a cell

http://www.cpearson.com/excel/events.htm
Chip Pearson's page on events (assuming it is back up - seemed to be

down
earlier)
--
Regards,
Tom Ogilvy

"dee" wrote in message
...
Hi,

Am trying to understand VBA object code. I know that the Modules

folders
contain sub routines for that workbook project.

I also noted that you can have code windows open for a particular

worksheet.
When I click on the down arrow and select General, this code appears
automatically:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

What does this mean?

--
Thanks!

Dee






Reply
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
how do i prepare a macro to insert drawing object on specific cell Harshad[_2_] Excel Discussion (Misc queries) 2 November 25th 08 08:06 AM
Macro to insert an object in a specific cell 2007` mpsears62 Excel Discussion (Misc queries) 2 July 7th 08 07:04 PM
embed an object that links to a specific worksheet or range maggiewall Excel Worksheet Functions 0 January 10th 07 11:34 PM
Excel Hyperlink to specific Access object Karla V Excel Discussion (Misc queries) 0 July 1st 05 02:35 PM
How do I embed an object into a specific cell in Excel? fish Excel Discussion (Misc queries) 0 June 15th 05 12:16 PM


All times are GMT +1. The time now is 02:55 PM.

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"