PC Review


Reply
Thread Tools Rate Thread

Activating userform and filling it with data form row where userform is activate

 
 
Marthijn Beusekom via OfficeKB.com
Guest
Posts: n/a
 
      3rd May 2005
I use a userform to mutate data in a sheet. I would like this userform to
be activated by a double click or press of button. The hard part is that I
would like the fields in the userform to be filled with data mentioned on
the selected row.

For example:

Cust.nr. Name phone age
1 Jan 1234567 20
2 Peter 1388431 25
3 Elco 3215687 30


I like peter's record to be mutated, so I would like to double click on
‘Peter’ to activate the userform. In this userform I want Peters current
data already mentioned.

My attempt of adding a button left of each row does not work. It does of
course activate the userform but there is no record mentioning that ‘button
on row 2’ was pressed. So the userform can not be filled with the data on
row 2.

I am out of clues. Can you help me?

--
Message posted via http://www.officekb.com
 
Reply With Quote
 
 
 
 
Harald Staff
Guest
Posts: n/a
 
      3rd May 2005
Hi

Put something like this in your userform module:

Public Sub FillMe(R As Long)
TextBox1.Text = Cells(R, 1).Value
'and so on
End Sub

and something like this in your worksheet module:

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Call UserForm1.FillMe(Target(1).Row)
UserForm1.Show
End Sub

HTH. Best wishes Harald

"Marthijn Beusekom via OfficeKB.com" <(E-Mail Removed)> skrev i
melding news:(E-Mail Removed)...
> I use a userform to mutate data in a sheet. I would like this userform to
> be activated by a double click or press of button. The hard part is that I
> would like the fields in the userform to be filled with data mentioned on
> the selected row.
>
> For example:
>
> Cust.nr. Name phone age
> 1 Jan 1234567 20
> 2 Peter 1388431 25
> 3 Elco 3215687 30
>
>
> I like peter's record to be mutated, so I would like to double click on
> 'Peter' to activate the userform. In this userform I want Peters current
> data already mentioned.
>
> My attempt of adding a button left of each row does not work. It does of
> course activate the userform but there is no record mentioning that

'button
> on row 2' was pressed. So the userform can not be filled with the data on
> row 2.
>
> I am out of clues. Can you help me?
>
> --
> Message posted via http://www.officekb.com



 
Reply With Quote
 
Tushar Mehta
Guest
Posts: n/a
 
      4th May 2005
I am curious why you think there is a need for a form when XL does a
pretty good job of handling data entry. Clearly, the user has access to
the worksheet so why won't they edit the worksheet directly?

Also, if you must, check out XL's native data form, rudimentary as it
is: Data | Form...

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

In article <(E-Mail Removed)>,
(E-Mail Removed) says...
> I use a userform to mutate data in a sheet. I would like this userform to
> be activated by a double click or press of button. The hard part is that I
> would like the fields in the userform to be filled with data mentioned on
> the selected row.
>
> For example:
>
> Cust.nr. Name phone age
> 1 Jan 1234567 20
> 2 Peter 1388431 25
> 3 Elco 3215687 30
>
>
> I like peter's record to be mutated, so I would like to double click on
> =3FPeter=3F to activate the userform. In this userform I want Peters current
> data already mentioned.
>
> My attempt of adding a button left of each row does not work. It does of
> course activate the userform but there is no record mentioning that =3Fbutton
> on row 2=3F was pressed. So the userform can not be filled with the data on
> row 2.
>
> I am out of clues. Can you help me?
>
>

 
Reply With Quote
 
Marthijn Beusekom via OfficeKB.com
Guest
Posts: n/a
 
      6th May 2005
Thanks Harald,
you pointed me in the right direction

--
Message posted via http://www.officekb.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
loading, but not activating userform c1802362 Microsoft Excel Programming 1 11th Dec 2008 03:56 AM
Closing Workbook then Activating Other Wb with Userform showing? dimm Microsoft Excel Programming 1 24th Feb 2008 03:21 PM
Filling a WS from a UserForm JK Microsoft Excel Programming 1 1st Dec 2005 03:40 AM
Activating scroll bars in a text box on a userform Fred Holmes Microsoft Excel Programming 0 18th Nov 2004 10:36 PM
Activating a Userform in VB when changing Cells in Excel =?Utf-8?B?Q1RJbnQwNA==?= Microsoft Excel Programming 1 30th Jun 2004 01:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 PM.