Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 Load Userform when clicking cell

How would be the best way to load a userform when a cell in column c i
clicked.

When this column is clicked, it takes text in that cell and places i
in a label in the form.

Thank you for your help. :

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 Load Userform when clicking cell

Also, it could be any cell in column c...

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Excel 2000 Load Userform when clicking cell

Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in message
...
How would be the best way to load a userform when a cell in column c is
clicked.

When this column is clicked, it takes text in that cell and places it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel 2000 Load Userform when clicking cell

Rob,

Can I ask why you create a form object and show that rather than just show.
Any specific advantages?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in message
...
Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in message
...
How would be the best way to load a userform when a cell in column c is
clicked.

When this column is clicked, it takes text in that cell and places it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Excel 2000 Load Userform when clicking cell

Just my style, but has another purpose too.

The way I originally did it was with .Show. Then the OK / Cancel buttons
would Unload Me to close the form.
But that left me without ability to return values the userform generated.

So I used this other approach which treated the userform more a black box.


I'd be interested to know how you resolve the problem of returning values
from a userform? Always looking at new ideas.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...
Rob,

Can I ask why you create a form object and show that rather than just

show.
Any specific advantages?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in message
...
Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in message
...
How would be the best way to load a userform when a cell in column c

is
clicked.

When this column is clicked, it takes text in that cell and places it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 2000 Load Userform when clicking cell

hide the form
harvest the values
unload the form

--
Regards,
Tom Ogilvy

"Rob van Gelder" wrote in message
...
Just my style, but has another purpose too.

The way I originally did it was with .Show. Then the OK / Cancel buttons
would Unload Me to close the form.
But that left me without ability to return values the userform generated.

So I used this other approach which treated the userform more a black box.


I'd be interested to know how you resolve the problem of returning values
from a userform? Always looking at new ideas.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...
Rob,

Can I ask why you create a form object and show that rather than just

show.
Any specific advantages?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in

message
...
Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in

message
...
How would be the best way to load a userform when a cell in column c

is
clicked.

When this column is clicked, it takes text in that cell and places

it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Excel 2000 Load Userform when clicking cell

Tom,

Thanks for your input.

This is the method I'm now using.

Cheers

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Tom Ogilvy" wrote in message
...
hide the form
harvest the values
unload the form

--
Regards,
Tom Ogilvy

"Rob van Gelder" wrote in message
...
Just my style, but has another purpose too.

The way I originally did it was with .Show. Then the OK / Cancel

buttons
would Unload Me to close the form.
But that left me without ability to return values the userform

generated.

So I used this other approach which treated the userform more a black

box.


I'd be interested to know how you resolve the problem of returning

values
from a userform? Always looking at new ideas.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...
Rob,

Can I ask why you create a form object and show that rather than just

show.
Any specific advantages?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in

message
...
Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in

message
...
How would be the best way to load a userform when a cell in column

c
is
clicked.

When this column is clicked, it takes text in that cell and places

it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/











  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel 2000 Load Userform when clicking cell

One of two ways Rob.

Either don't unload the form, just hide it, and then as the form is still in
memory the variables and controls are still accessible. The disadvantage
here is obviously that the form is still in memory, but how big an overhead
that is will depend upon the application.

The other way I also use is to save the values in a standard module variable
before exiting the form.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in message
...
Just my style, but has another purpose too.

The way I originally did it was with .Show. Then the OK / Cancel buttons
would Unload Me to close the form.
But that left me without ability to return values the userform generated.

So I used this other approach which treated the userform more a black box.


I'd be interested to know how you resolve the problem of returning values
from a userform? Always looking at new ideas.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Bob Phillips" wrote in message
...
Rob,

Can I ask why you create a form object and show that rather than just

show.
Any specific advantages?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in

message
...
Here's one way:

Create a new userform: UserForm1
Drop a label control on it: Label1

Then in your worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frm As UserForm1

If Target.Column = Columns("C").Column Then
Set frm = New UserForm1
frm.Label1 = Target.Value
frm.Show
Unload frm
Set frm = Nothing
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"scain2004 " wrote in

message
...
How would be the best way to load a userform when a cell in column c

is
clicked.

When this column is clicked, it takes text in that cell and places

it
in a label in the form.

Thank you for your help. :)


---
Message posted from http://www.ExcelForum.com/









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
all of a sudden my excel 2000 won't load zennith27 Excel Discussion (Misc queries) 1 January 22nd 10 07:50 PM
Load image from directory for custom toolbar of Excel 2000 Padam Excel Worksheet Functions 0 August 5th 06 06:33 PM
why templates do not load into excel 2000? Ron Excel Discussion (Misc queries) 2 December 23rd 04 06:31 PM
Load a Userform Nick Excel Programming 1 September 10th 03 03:24 PM
load userform from other VBProject (Excel 2000) Keith Willshaw Excel Programming 1 July 28th 03 04:12 PM


All times are GMT +1. The time now is 01:50 AM.

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"