Please explain modules/sheets/workbooks

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

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
 
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
 
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
 
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?
 
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
Dinâmicas), 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: (e-mail address removed)
 
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
Dinâmicas), 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: (e-mail address removed)
 

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

Back
Top