Buttons in Excel?

Z

Zalek Bloom

Is it possible in Excel to create a button? I am creating a time sheet
application - time worked for a week. Instead of entering the
starting date (day, month, year) for the next week, I want just to
click a button, and Excel will automatically add 7 days to the
starting date.
Is it possible?

Thanks,

Zalek
 
J

JE McGimpsey

It's certainly possible. Here's one way:

Choose View/Toolbars/Forms to show the Forms toolbar. Click the Button
control and drag in the worksheet to create a button. In the Assign
Macro dialog that opens, click New. Enter this macro in the macro module
that opens:

Sub Button1_Click()
Range("A1").Value = Range("A1").Value + 7
End Sub



(change A1 to the cell reference of the cell that contains your date),
then type ALT-F11 to go back to XL..
 
S

Sid

My personal preference for buttons is to use an AUTOSHAPE
(usually a rectangle). Assign a macro to the autoshape.
You can add background color and text to suit your needs.
Try it . . . you'll like it! Sid
 
C

CLR

Autoshapes are my personal preference also........one neat thing, is that
you can make them small and "invisible" and they will still trigger a
macro...........(IF you know where to find them <G>).........

Vaya con Dios,
Chuck, CABGx3
 

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

Top