ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Absolute beginner (https://www.excelbanter.com/excel-programming/392371-absolute-beginner.html)

Ant

Absolute beginner
 
Hi,

I'm an absolute beginner with excel. I've had a lot of experience with VB6,
but code aside, it's a different beast!

How do you turn a cell into a button that responds to a click event in which
I can write code? Or how is a similar thing done. Events! I need Events!

Thanks very much
your humbly
Ant

Rick Rothstein \(MVP - VB\)

Absolute beginner
 
I'm an absolute beginner with excel. I've had a lot of experience with
VB6,
but code aside, it's a different beast!

How do you turn a cell into a button that responds to a click event in
which
I can write code? Or how is a similar thing done. Events! I need Events!


You can put a CommandButton right on the spreadsheet and then work with
that. If you haven't already done so, select View/Toolbars/Visual Basic from
Excel's menu bar. Click on the Control Toolbox icon from the Visual Basic
tool bar (looks like a wrench and hammer crossed over each other). This will
add the Control Toolbar to the spreadsheet's tool bars. From the Control
Box, click on the CommandButton icon and draw it onto your spreadsheet (size
it as necessary). If you are not already in Design Mode, select the Design
Mode icon from the Visual Basic tool bar (it's to the right of the Control
Toolbox icon). Once that is done, right click the CommandButton and select
Properties from the popup menu; double-click it to reach its event coding
window.

Rick


Ant

Absolute beginner
 
Hi Rick,

Thanks very much! That'll get me started

Cheers

Ant

"Rick Rothstein (MVP - VB)" wrote:

I'm an absolute beginner with excel. I've had a lot of experience with
VB6,
but code aside, it's a different beast!

How do you turn a cell into a button that responds to a click event in
which
I can write code? Or how is a similar thing done. Events! I need Events!


You can put a CommandButton right on the spreadsheet and then work with
that. If you haven't already done so, select View/Toolbars/Visual Basic from
Excel's menu bar. Click on the Control Toolbox icon from the Visual Basic
tool bar (looks like a wrench and hammer crossed over each other). This will
add the Control Toolbar to the spreadsheet's tool bars. From the Control
Box, click on the CommandButton icon and draw it onto your spreadsheet (size
it as necessary). If you are not already in Design Mode, select the Design
Mode icon from the Visual Basic tool bar (it's to the right of the Control
Toolbox icon). Once that is done, right click the CommandButton and select
Properties from the popup menu; double-click it to reach its event coding
window.

Rick




All times are GMT +1. The time now is 04:07 PM.

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