User form to comments

G

Guest

I have one that's way out of my league:

I would like to first make a user form that activates when shortcut (ctrl+x)
is used on a cell. This would then allow the user to fill in the data for
name, CC#, Exp date, the date the data was entered, phone #, TOA (time and
date), # of days.

So here's the hitch, I need the userform to then enter the data into
comments for the cell that the shortcut key was used on. So in the end the
cell has the info of the userform in comments and the user can view the data
by resting the mouse over the comments red indicator.

Is this possible??

Thanks to all in advance for any help in the matter!
 
T

Tom Ogilvy

Here is information on userforms:

http://j-walk.com/ss/excel/tips/tip84.htm

See this tutorial here
http://www.dicks-blog.com/excel/2004/09/linking_userfor.html

XL97: How to Use a UserForm for Entering Data (Q161514)
http://support.microsoft.com/?id=161514

XL2000: How to Use a UserForm for Entering Data (Q213749)
http://support.microsoft.com/?id=213749


Here are some other sources of information:

http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.


http://support.microsoft.com/?id=168067
File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
Controlling UserForms in Microsoft Excel 97
File Name: WE1163.EXE
File Size: 161742 bytes
File Date: 05/08/97
Keywords: kbfile
Description: This Application Note is an introduction to manipulating
UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
Basic for Applications macros that show you how to take advantage of the
capabilities of UserForms and use each of the ActiveX controls that are
available for UserForms

Peter Aiken Articles:
Part I
http://msdn.microsoft.com/library/en-us/dnoffpro01/html/IntroductiontoUserFormsPartI.asp
Part II
http://msdn.microsoft.com/library/en-us/dnoffsol02/html/IntroductiontoUserFormsPartII.asp


you can assign a shortcut key by running a macro that executes the OnKey
command. See Excel VBA help.

You can see how to update/create a comment by turning on the macro recorder
and creating the comment manually one time. Then turn off the macro recorder
and look at the code. .

ActiveCell can be used to determine what cell was selected when you did
Ctrl+g
 
G

Gary Keramidas

test this in a blank worksheet with a userforn that has 4 textboxes and 1
commandbutton: you can assign a macro that uses control -x to show the form
(userform.show)

Option Explicit

Private Sub CommandButton1_Click()
Dim cmt As String, i As Long
For i = 1 To 4
cmt = Me.Controls("textbox" & i).Value & " " & cmt

Next
ActiveCell.AddComment cmt
End Sub
 

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