Using The Visual Basic Editor

If you have multiple workbooks open in Excel, you can copy modules and UserForms between them by using the Project Explorer window. To copy an object, click the desired object and drag it to another workbook. When you release the mouse button, the Visual Basic Editor creates a copy of the selected module in the specified project. By default, the Visual Basic Editor names the copied module the same as the module in the original project. When you copy an object to another project, if one already exists with that name, the Visual Basic Editor renames the object by adding a 1 to the end of the name. For example, if you copy Module2 to a different project and that project contains a Module2 object, the copied object name becomes Module21. If you have a Module 21, the Visual Basic Editor names the copied object Module 22.

You can change the name of the copied module on the Properties window. To do so, you type a new name in the Name field and then press Enter. The Name of the module changes on the corresponding node in the Project Explorer window.

m

File " Edit V

ew insert

Format

Data

Window Help

| Type

question for help ||

X

& y B

a sa? *

%

m - o.

S -

l\ SOI 4>> 100»

-w.

A rial

- 10 - B /

U

%

j to

- A .

H3

f*

A

n

E

F

G

H

K

1 2

Office Expenses

Rent

Advertising

Phone

ISP

Parking

Misc.

3

Jailli arv

350

iotr

-20C

-m

50

1751

March

April

350

yj

145

350

550

31C

11C

5Q

123

350

795

25C

11C

50

211

350

800

245

11 c

50

345

350

795

31C

11 c

50

149

350

B00

34C

11 c

50

190

16

August

350

yu

m

111

bU

l&ti

September

350

d4b

40C

11C

50

296

October

350

¡Mrt

45C

11L

50

245

November

350

w

455

110

5Q

405

December

350

1005

500

50

605

1/ 18 19

L

20

21

22

25

» H \sheetl / Sheet2

Sheet3

1

ir

y

LOCK PROJECT FROM EDITING

it View Insert Format Debug Run Tools fldd-Ins Windi

1u * fe■ m|' <- ► ii ■ t£ %i tf1 w if 113

LOCK PROJECT FROM EDITING

Click the Protection tab.

—0 Click the Lock project for viewing option ( Q changes 0 ).

□ Type the password required to unlock the project.

-O Type the password again.

■ Excel applies your settings it View Insert Format Debug Run Tools fldd-Ins Windi

1u * fe■ m|' <- ► ii ■ t£ %i tf1 w if 113

Click the locked project.

■ A Password dialog box displays.

ÜJ Close the Visual Basic Editor.

— Open the Visual Basic Editor.

Note: See the section "Activate the Visual Basic Editor" to open the VBE.

Click the locked project.

■ A Password dialog box displays.

Excel opens the project.

0 0

Post a comment