Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Creating a form on a worksheet - Can I make a button for "notes"

Is it possible to have a button on a worksheet and just have the buttons say
"notes". Then when it's pressed a dailog box opens for the data entry?. If
so, how is this done, which kind of control should I use, etc.?
  #2   Report Post  
Zack Barresse
 
Posts: n/a
Default

Hi,

You would best be to post this in the excel.programming newsgroup, as I
suspect you'll need VBA.

I guess, to not leave you hanging, I would do something like this ...

From Excel, hit Alt + F11, then press Ctrl + R.
Select your file (bold name) on left.
Select Insert (menu) | Module
Copy paste the code below there.
Press Alt + Q to return to Excel.
From the Forms toolbar, select a Command Button and create it.
An 'Assign Macro' dialog will appear, select 'InsertNote' and click Ok.
Save before running anything.

Code to copy/paste:

Option Explicit
Sub InsertNote()
Dim rng As Range
Dim strNote As String
Set rng = Selection
If rng.Cells.Count 1 Then
MsgBox "Please select only one cell."
Exit Sub
End If
If Len(ActiveCell) 0 Then
If MsgBox("There is already data in this cell." & vbNewLine & _
"Overwrite?", vbYesNo, "Overwrite?") = vbNo Then Exit Sub
strNote = InputBox("Enter new cell value:", "Enter Value")
If strNote < "" Then ActiveCell.Value = strNote
End If
End Sub

Note that this will not leave a cell blank if nothing has been typed into
the InputBox. If you would like to add such functionality, replace the
bottom two lines with this one line ...


ActiveCell.Value = InputBox("Enter new cell value:", "Enter Value")

If you do this, you can take out this line as well ...

Dim strNote As String

HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



wrote in message
news:v6X0f.397196$_o.270460@attbi_s71...
Is it possible to have a button on a worksheet and just have the buttons
say
"notes". Then when it's pressed a dailog box opens for the data entry?. If
so, how is this done, which kind of control should I use, etc.?



  #3   Report Post  
 
Posts: n/a
Default

Wow,

I haven't used excel for a few years now. I didn't think it would be this
involved! I'll take this see what happens and hopefully if not I change or
modify whatever needs fixin' to get it to work

Thank, Paul
  #4   Report Post  
Zack Barresse
 
Posts: n/a
Default

Paul,

I guess some may think it a little 'over-the-top'. I use a lot of VBA
throughout the day for my job, so naturally that is what I jump to first.
For me, this just seems the simplest and fastest way to give the the exact
results you requested. I'm sure there are many other ways. I apologize if
it was too lenghty.

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)


wrote in message
news:xc21f.399499$_o.302556@attbi_s71...
Wow,

I haven't used excel for a few years now. I didn't think it would be this
involved! I'll take this see what happens and hopefully if not I change or
modify whatever needs fixin' to get it to work

Thank, Paul



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to make Excel only run certain formulas on a worksheet? jrusso Excel Discussion (Misc queries) 0 January 12th 05 04:23 PM
how to make an order form for a Flower sale? Avanti007 Excel Discussion (Misc queries) 1 January 9th 05 02:01 PM
Is there a way to make Excel 2000 open a new worksheet in a new w. gdub Excel Discussion (Misc queries) 1 December 22nd 04 03:56 PM
make large worksheet from workbook Cowtoon Excel Discussion (Misc queries) 5 December 6th 04 08:24 PM
better search: "make worksheet visible" christo Excel Discussion (Misc queries) 1 December 1st 04 12:20 AM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"