ActiveX Controls

Figure 10-2 shows four types of ActiveX controls embedded in the worksheet. The scrollbar in cells C3:F3 allows you to set the value in cell B3. The spin button in cell C4 increments the growth percentage in cell B4. The checkbox in cell B5 increases the tax rate in cell B16 from 30% to 33%, if it is checked. The option buttons in column I change the cost factor in cell B15, and also change the maximum and minimum values for the scrollbar.

K

c.

■0

£ f a

M- I

m

È

L

M

1

Amalgamated Fruit Inc

- Profit Planner

5 7

Jan Sales Sales Growth/Mo Tax Increase?

160.000

i 1 » 1

_ill

Mangoes Lyttees flananas r Hamtwtan

9 "10

Sales Costs

160,000 94.506

151.500 35 445

154.545 156,091 157.652 37.363 98 337 99.320

Jul Aug

159,228 160 820 100.314 101 317

Sep 152,429 102.330

164.053 103.353

165 693 104.387

1.902 375 1,198.497

11 12

Profit Before Tax Tax

56.500 10.315

56.055 18 490

56.516 18 583

57.182 57,754 55.331 18870 19 059 19.243

53.914 59.504 19.442 19.636

50.099 19 533

60 700 20,031

61.307 20.231

B1.920 20 433

703 379 232.280

16 JZ

Profit After Tax

37.136

37 657

37,932

33.312 33,535 39,082

39.473 39.367

40,266

40.663

41 075

41 436

471 693

Cost Factor Tax Rate

53% 33%

► H Profit iilMteQ j

Figure 10-2

An ActiveX control can be linked to a worksheet cell, using its LinkedCell property, so that the cell always displays the Value property of the control. None of the ActiveX controls shown in Figure 10-2 use a link cell, although the scrollbar could have been linked because its value is displayed in B3. Each control uses an event procedure to make its updates. This gives you far more flexibility than a simple cell link and removes the need to dedicate a worksheet cell to the task.

Was this article helpful?

0 0

Post a comment