Open form on Enter

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

In my macro, the user would to move to a specific cell.
When they hit the "Enter" key, I would like for a form to
open. The user would then enter data into the form based
on the line in the spreadsheet that they are in. Once they
enter all of the data, they would hit a button, the info
would be displayed on another sheet, the form would close,
and the cell on the next line would be active.

Is this possible? I'm having some trouble getting the
form to display when the "Enter" key is hit.

Any suggestions would be appreciated. Thanks..
 
You say move to a specific cell to trigger the form, but then you want the
form to react to the cell they are in. Wouldn't the cell always be the
"specifc cell" that triggers the action.

Is specific cell actually a cell on any row in a particular column. I thing
a clear explanation is needed.
 
The user will move to any row in col D. What I would like
is for them to hit the Enter key. When they hit the Enter
Key, the form is displayed.

Is it possible to display a form, have the user key data
into the form, update another sheet in the workbook before
the next cell in the original sheet is activated?

Thanks for the help.
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Static OldCell As Range
If OldCell Is Nothing Then
Set OldCell = Me.Range("A1")
Else
MsgBox Target.Address & " - " & OldCell.Address
End If
If OldCell.Column = 4 Then
Load UserForm1
UserForm1.Label1.Caption = OldCell.Row
UserForm1.Show
End If
Set OldCell = Target
End Sub

would be a start
 

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