Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default VB Code Location; sheet, workbook, module

I'm new to VB. Does it matter whether I put my VB code in the sheet, workbook
or modules on the VB window?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default VB Code Location; sheet, workbook, module

It sure does. You might want to consider taking Lesson1 of Excel VBA
Training at http://www.vbaexpress.com/training/

In a nutshell:
Put it in a module if you're unsure.
Anything that you want to occur on a specific worksheet as a result of a
specific action, put in the worksheet code.
Anything that you want to occur in the workbook, such as before you close it
or save it or when you open it, then the code should go in ThisWorkbook.
Well, there's class modules too. I know Chip Pearson has some good info
about it. Though it says Excel 97, things haven't changed a whole heckuva
lot:
http://www.cpearson.com/excel/events.htm
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



"James Hamilton" wrote in message
...
I'm new to VB. Does it matter whether I put my VB code in the sheet,

workbook
or modules on the VB window?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default VB Code Location; sheet, workbook, module

Many thanks Anne.

"Anne Troy" wrote:

It sure does. You might want to consider taking Lesson1 of Excel VBA
Training at http://www.vbaexpress.com/training/

In a nutshell:
Put it in a module if you're unsure.
Anything that you want to occur on a specific worksheet as a result of a
specific action, put in the worksheet code.
Anything that you want to occur in the workbook, such as before you close it
or save it or when you open it, then the code should go in ThisWorkbook.
Well, there's class modules too. I know Chip Pearson has some good info
about it. Though it says Excel 97, things haven't changed a whole heckuva
lot:
http://www.cpearson.com/excel/events.htm
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com



"James Hamilton" wrote in message
...
I'm new to VB. Does it matter whether I put my VB code in the sheet,

workbook
or modules on the VB window?

Thanks.




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
Sheet Code Module: copying code to [email protected][_2_] Excel Programming 2 December 14th 04 01:57 AM
Sheet code module question Stuart[_5_] Excel Programming 1 August 9th 04 07:14 AM
Adding Code to the This_workbook module of a created workbook RPIJG[_68_] Excel Programming 1 July 9th 04 06:35 PM
Write VBA code into a sheet module using VBA quartz Excel Programming 0 January 20th 04 08:01 PM
Adding Code Module to Workbook Charles Excel Programming 2 January 6th 04 08:43 AM


All times are GMT +1. The time now is 11:26 PM.

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

About Us

"It's about Microsoft Excel"