View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default When this happens, do that, then do the next thing

A little modification to Patrick's code:

Option Explicit
Private Sub CommandButton1_Click()
If Selection.Column 1 Then
Selection.Offset(, -1) = TextBox1.Text
End If
End Sub

This avoids an error message when the selection is in Column "A".


"Patrick Molloy" wrote in message
...
use the sheet's Change event to show the userform...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
UserForm1.Show
End If
End Sub


next, the button on the userform ....would drop the text into the
adjascent cell. so the userform code woulkd be like

Option Explicit
Private Sub CommandButton1_Click()
Selection.Offset(, -1) = TextBox1.Text
End Sub

"Jock" wrote in message
...
When a date is placed in "E", Userform1 to appear.
The user can fill in upto four seperate text boxes on the Userform with
text.
A button on the Userform will close it and copy the text from the
userform
to a comment in the adjacent cell in "D"

Is this do-able?
--
Traa Dy Liooar

Jock