Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Possible to read data entered in a worksheet's Form object, using a VBA command?

Hi,

I have an Excel workbook which had worksheet's own form objects and also
objects created with VBA's control toolbox.

Specifically I have a drop down form object called DropDown6 (I see no way
of changing the name). In my VBA code, I want to capture the data the user
had previously picked from this drop down & do further processeing with it.
I know that I can assign a macro to the dropdown, but I want to do other
things which are to be triggered by a separate command button.

Is it possible to use a VBA command to capture the data the user had
previously picked in this drop down?

Regards...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Possible to read data entered in a worksheet's Form object, using a VBA command?

Place this in the subroutine for for the command button. Change the
sheet name and DropDown name as needed. strWI will return the value
selected by the user.

Dim drpWI As DropDown
Dim strWI As String

Set drpWI = ThisWorkbook.Sheets("MySht").DropDowns("DropDown6" )
With drpWI
strWI = .List(.ListIndex)
End With

--------------------------------------------------------------------------------------------------------------

When I want to change the name of an object from the Forms Toolbar, I
select the object and use the Immediate Window to change the name.

Selection.Name = "Desired Name"

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Hi,

I have an Excel workbook which had worksheet's own form objects and also
objects created with VBA's control toolbox.

Specifically I have a drop down form object called DropDown6 (I see no way
of changing the name). In my VBA code, I want to capture the data the user
had previously picked from this drop down & do further processeing with it.
I know that I can assign a macro to the dropdown, but I want to do other
things which are to be triggered by a separate command button.

Is it possible to use a VBA command to capture the data the user had
previously picked in this drop down?

Regards...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Possible to read data entered in a worksheet's Form object, using a VBA command?

Hello Paul,

I get run-time error 1004 - Unable to get the DropDowns property of the
worksheet class, at the following statement:
Set drpWI = ThisWorkbook.Sheets("MySht").DropDowns("DropDown6" )

Also how do you change the name of the drop down. There is no property
window for it, only for the sheet as a whole.

Android...

wrote in message
...
Place this in the subroutine for for the command button. Change the
sheet name and DropDown name as needed. strWI will return the value
selected by the user.

Dim drpWI As DropDown
Dim strWI As String

Set drpWI = ThisWorkbook.Sheets("MySht").DropDowns("DropDown6" )
With drpWI
strWI = .List(.ListIndex)
End With

--------------------------------------------------------------------------

------------------------------------

When I want to change the name of an object from the Forms Toolbar, I
select the object and use the Immediate Window to change the name.

Selection.Name = "Desired Name"

HTH
Paul
--------------------------------------------------------------------------

------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------

------------------------------------

Hi,

I have an Excel workbook which had worksheet's own form objects and also
objects created with VBA's control toolbox.

Specifically I have a drop down form object called DropDown6 (I see no

way
of changing the name). In my VBA code, I want to capture the data the

user
had previously picked from this drop down & do further processeing with

it.
I know that I can assign a macro to the dropdown, but I want to do other
things which are to be triggered by a separate command button.

Is it possible to use a VBA command to capture the data the user had
previously picked in this drop down?

Regards...




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
Copying data entered into a form to another workbook zak Excel Discussion (Misc queries) 0 December 29th 08 12:14 PM
Why won't vlookup read newly entered data from a source file? mwgrutter Excel Discussion (Misc queries) 3 June 5th 07 10:09 PM
Can a cell be linked to read data entered into a text box ? theltgguy Excel Discussion (Misc queries) 0 May 11th 06 09:24 PM
Can a cell be linked to read data entered into a text box ? theltgguy Excel Discussion (Misc queries) 0 May 11th 06 09:15 PM
Command: Data, Form David Goldsmith Excel Programming 1 October 2nd 03 10:33 AM


All times are GMT +1. The time now is 09:13 AM.

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"