code suggestion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to assign a function to a command button. Upon a single
mouse click it will report a preassigned cell value to a target address. The
application is a freestyle kayak competition judging spreadsheet. The result
will automate the judging.

Thoughts?
 
I can help with the assigning a macro to a command button part

Rightclick the toolbar, select customise, select the commands tab.

Click on Macro under the "Categories" box. Then select Custom Button
from the Commands box.

Drag the button to the tool bar. Once you have done that right click on
the button and select Assign macro. Then select the macro you want to
assign and click OK.

First you will need to design the macro!

Regards
Gazzr
 
If you want the click of the button to assign a value to the currently
selected (active) cell, then this code for the button will work:
Sub Button2_Click()
ActiveCell.Value = 56
End Sub

This would always assign a value of 56 to the active cell when the button is
clicked.

If you need it to put a specified value into a particular cell on the
currently active sheet then use something like this:
Range("A1").Value = 56

Then no matter where you are on the sheet, the value 56 would always be
placed into A1 on the currently active sheet.
 

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