Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UserForm howto?


Task: I need to write a macro that grabs a particular Range and generate
a userform with a combobox.

Description:
Sheet1 contains names in cells D4:D34
Sheet2 has an action button which when clicked needs to:
- read the names in the afore mentioned range
- generate a pop-up userform that contains the list of names
in a combo box

From there, the user picks a name and hits an Okay (or other button)
which will then use their selection to perform some action.

I've been reading up on creating userforms, but I'm having a hard time
trying to figure out how to create something based on fluid data.


--
AMK4
------------------------------------------------------------------------
AMK4's Profile: http://www.excelforum.com/member.php...o&userid=19143
View this thread: http://www.excelforum.com/showthread...hreadid=506121

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default UserForm howto?

Hello AMK4,

There is several ways to attack you problem. But propably the easiest way.
First Insert a UserForm, from VB Editor. Then on the UserForm place
Combobox or or ListBox. In my example I use a ComboBox and name it
'cbox_Name'. Also add the CommandButton to the UserForm. Now place the
following code under the "UserForm_Initialize()" event. This code load
comboBox with the names on Sheet1, cells D4:D34. This event is execute
prior to showing the UserForm. I hope this gives you a starting point. For
your UserForm...

Rick, freezen in Alaska




Private Sub UserForm_Initialize()
Dim ws1 As Worksheet
Dim x As Integer

Set ws1 = Worksheets("Sheet1")

Me.cbox_Name.Clear
Me.cbox_Name.RowSource = ""

For x = 4 To 34
Me.cbox_Name.AddItem ws1.Cells(x, "D").Value
Next x


End Sub


"AMK4" wrote in message
...

Task: I need to write a macro that grabs a particular Range and generate
a userform with a combobox.

Description:
Sheet1 contains names in cells D4:D34
Sheet2 has an action button which when clicked needs to:
- read the names in the afore mentioned range
- generate a pop-up userform that contains the list of names
in a combo box

From there, the user picks a name and hits an Okay (or other button)
which will then use their selection to perform some action.

I've been reading up on creating userforms, but I'm having a hard time
trying to figure out how to create something based on fluid data.


--
AMK4
------------------------------------------------------------------------
AMK4's Profile:

http://www.excelforum.com/member.php...o&userid=19143
View this thread: http://www.excelforum.com/showthread...hreadid=506121



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
howto: concat (x1:x3) Marc Hebert New Users to Excel 3 December 15th 06 07:52 PM
HowTo add and name 2 wks to wkbk Dan Excel Programming 2 March 5th 05 09:36 PM
Howto Show importerd userform Raymond[_6_] Excel Programming 1 January 21st 04 11:52 AM
HOWTO Replace from Row Don Guillett[_4_] Excel Programming 9 August 24th 03 03:14 PM
HOWTO Replace from Row SolaSig AB Excel Programming 0 August 22nd 03 12:12 PM


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

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

About Us

"It's about Microsoft Excel"