ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please explain modules/sheets/workbooks (https://www.excelbanter.com/excel-programming/398938-please-explain-modules-sheets-workbooks.html)

Andrew[_56_]

Please explain modules/sheets/workbooks
 
Hello,
I am new to VBA, but I have been programming for many years. I am
trying to sort out the difference between a module, a worksheet, and a
workbook. In a single project, I can write code in a module, and/or a
worksheet, and/or a workbook. And if I write code in sheet 1, I can
use it to access all the other sheets in the project. So why is VBA
set up this way? What is the difference between a module, a sheet,
and a workbook? And how does it benefit me to have all these places
to write code, as opposed to just a single code location?

thanks for the help
Andrew


JLGWhiz

Please explain modules/sheets/workbooks
 
A module is where the Visual Basic code is stored. There are different types
of modules. A general module is one from which your code can access all
workbooks, worksheet, UserForms, controls and other applications. A sheet
module is contained within a specific sheet and has limited ability for the
code to access and execute out side that sheet. The controls modules apply
to each individual control.

Workbooks are collections of sheets that can be used to organize a project,
maintain similar type records or if desired store various data files.

A worksheet or sheet within the workbook is a defined set of ranges (in
Excel 2003 it is 256 x 65536 cells) Worksheet refers to the Excel
spreadsheet format while Sheet can be either the spreadsheet or a chart.

There are websites that have basic beginner examples and explanations. One
of them is:

http://www.excel-vba.com/excel-vba-contents.htm



"Andrew" wrote:

Hello,
I am new to VBA, but I have been programming for many years. I am
trying to sort out the difference between a module, a worksheet, and a
workbook. In a single project, I can write code in a module, and/or a
worksheet, and/or a workbook. And if I write code in sheet 1, I can
use it to access all the other sheets in the project. So why is VBA
set up this way? What is the difference between a module, a sheet,
and a workbook? And how does it benefit me to have all these places
to write code, as opposed to just a single code location?

thanks for the help
Andrew



Dave D-C[_3_]

Please explain modules/sheets/workbooks
 
While you're on a roll (thank you), would you give a similar overview
of controls:
1) from the forms toolbar
2) from the Visual Basic Toolbar
3) from the Toolbox in the VBA IDE
Thanks, D-C

JLGWhiz wrote:
A module is where the Visual Basic code is stored. There are different types
of modules. A general module is one from which your code can access all
workbooks, worksheet, UserForms, controls and other applications. A sheet
module is contained within a specific sheet and has limited ability for the
code to access and execute out side that sheet. The controls modules apply
to each individual control.

Workbooks are collections of sheets that can be used to organize a project,
maintain similar type records or if desired store various data files.

A worksheet or sheet within the workbook is a defined set of ranges (in
Excel 2003 it is 256 x 65536 cells) Worksheet refers to the Excel
spreadsheet format while Sheet can be either the spreadsheet or a chart.

There are websites that have basic beginner examples and explanations. One
of them is:

http://www.excel-vba.com/excel-vba-contents.htm



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Dave D-C[_3_]

Please explain modules/sheets/workbooks
 
I didn't mean to ask for an overview of the many individual controls,
but the difference between the groups of controls.
Such as (3) being only for Userforms?
And (2) being similar to (1) with events added?
Is there more to say?

D-C wrote:
While you're on a roll (thank you), would you give a similar overview
of controls:
1) from the forms toolbar
2) from the Visual Basic Toolbar
3) from the Toolbox in the VBA IDE



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

InAnyPlace

Please explain modules/sheets/workbooks
 
A&A - PRESTAÇÃO DE SERVIÇO.

Melhore suas planilhas!

- Deixe-as mais rápidas
- Torne-as mais funcionais
- Aplique lay-outs mais modernos
- Melhore a apresentação dos seus dados
- impressione os gerentes e a diretoria

Crie o seu M.I.S. personalizado, desenvolva um Dataware, implemente
seu BI.

- Envie dados do seu Banco de Dados
diretamente para a sua aplicação

- Recolha informações diretamente da
Web (Cotações, Taxas, Alíquotas, etc...)

Programação VBA, Reports, Dashboards, Pivot Tables (Tabelas
Dinmicas), Ordenações, Agrupamentos, Interfaces, etc. . .

Entre em contato. Prestamos serviço diretamente pela Internet.

Você envia e implementamos sua solicitação.

Também desenvolvemos aplicações MS Access.

Mail:


InAnyPlace

Please explain modules/sheets/workbooks
 
A&A - PRESTAÇÃO DE SERVIÇO.

Melhore suas planilhas!

- Deixe-as mais rápidas
- Torne-as mais funcionais
- Aplique lay-outs mais modernos
- Melhore a apresentação dos seus dados
- impressione os gerentes e a diretoria

Crie o seu M.I.S. personalizado, desenvolva um Dataware, implemente
seu BI.

- Envie dados do seu Banco de Dados
diretamente para a sua aplicação

- Recolha informações diretamente da
Web (Cotações, Taxas, Alíquotas, etc...)

Programação VBA, Reports, Dashboards, Pivot Tables (Tabelas
Dinmicas), Ordenações, Agrupamentos, Interfaces, etc. . .

Entre em contato. Prestamos serviço diretamente pela Internet.

Você envia e implementamos sua solicitação.

Também desenvolvemos aplicações MS Access.

Mail:



All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com