Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default When this happens, do that, then do the next thing

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default When this happens, do that, then do the next thing

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default When this happens, do that, then do the next thing

Ok, first part working - userform appears and I can fill in the text boxes.
When I hit the command button, I need the code to copy the (up to 10) text
box contents and place them in a comment (not a cell) in the adjacent cell
and close the UserForm :)
--
Traa Dy Liooar

Jock


"JLGWhiz" wrote:

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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default When this happens, do that, then do the next thing

the userform only opens when a change in column 5 (E) is made .... as per
the original ...

If Target.Column = 5 Then


When a date is placed in "E", Userform1 to appear.


plus the button click event ??? what button? the event used is the sheet's
CHANGE event


"JLGWhiz" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default When this happens, do that, then do the next thing

slight amendment to userform code:

Option Explicit
Private Sub CommandButton1_Click()
Selection.Offset(, -1) = TextBox1.Text & textbox2.Text ' and so on
Me.Close
End Sub

"Jock" wrote in message
...
Ok, first part working - userform appears and I can fill in the text
boxes.
When I hit the command button, I need the code to copy the (up to 10) text
box contents and place them in a comment (not a cell) in the adjacent cell
and close the UserForm :)
--
Traa Dy Liooar

Jock


"JLGWhiz" wrote:

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




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default When this happens, do that, then do the next thing

There is a command button the user form.
When this button is clicked, your code will copy the text boxes to an
adjacent cell.
How can this code be modified to create a comment in the adjacent cell and
copy the text box contents to it.
I have been trying this: Target.Offset(0, -1).AddComment = TextBox1.Text & "
" & TextBox2.Text
but am getting compile errors!

--
Traa Dy Liooar

Jock


"Patrick Molloy" wrote:

the userform only opens when a change in column 5 (E) is made .... as per
the original ...

If Target.Column = 5 Then


When a date is placed in "E", Userform1 to appear.


plus the button click event ??? what button? the event used is the sheet's
CHANGE event


"JLGWhiz" wrote in message
...
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



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default When this happens, do that, then do the next thing

if you're in the =userform, then Target has no meaning as its only in scope
while in the change event of the sheet.

Hoever, the cell that raised the event is still selected, hence in my
userform i used

Selection.Offset(, -1) = TextBox1.Text

so try changing Target to Selection


"Jock" wrote in message
...
There is a command button the user form.
When this button is clicked, your code will copy the text boxes to an
adjacent cell.
How can this code be modified to create a comment in the adjacent cell and
copy the text box contents to it.
I have been trying this: Target.Offset(0, -1).AddComment = TextBox1.Text &
"
" & TextBox2.Text
but am getting compile errors!

--
Traa Dy Liooar

Jock


"Patrick Molloy" wrote:

the userform only opens when a change in column 5 (E) is made .... as per
the original ...

If Target.Column = 5 Then


When a date is placed in "E", Userform1 to appear.


plus the button click event ??? what button? the event used is the
sheet's
CHANGE event


"JLGWhiz" wrote in message
...
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



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
not sure if i'm using the right thing Tiffany Excel Worksheet Functions 4 September 19th 08 05:21 PM
For/Next using Thing Lindy[_2_] Excel Programming 3 December 3rd 04 07:18 PM
Doing it's own thing André Excel Programming 3 July 9th 04 11:30 PM
Another thing Richard Excel Programming 0 May 21st 04 04:21 PM
oh, and another thing ted daniels Excel Programming 2 April 22nd 04 05:34 PM


All times are GMT +1. The time now is 11:00 PM.

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

About Us

"It's about Microsoft Excel"