473,856 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VBA excel: How to enable combobox selection

2 New Member
I want to store data’s in selected sheet from drop down menu in userform .Suppose if I select sheet 1 data should be stored in sheet1 if I select sheet2 data’s should be stored in sheet2 . With the code below I can add sheet names in combo box. If someone helps me I shall be grateful to you.
Expand|Select|Wrap|Line Numbers
  1. Private Sub UserForm_Initialize()
  2. Dim i As Integer
  3. For i = 1 To Worksheets.Count
  4.     Me.ComboBox1.AddItem Worksheets(i).Name
  5. Next i
  6. End Sub
Jul 19 '10 #1
1 2501
MikeTheBike
639 Recognized Expert Contributor
@josef01
Hi

That seem fine, so fare, but what is the problem?

MTB
Jul 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4022
by: Smokey Joe | last post by:
Moving from a text box to a combobox where the text box validate sub sets the text box enable to false the combobox "lights up" indicating it has focus, but the gotfocus does not fire and when I tab out of the combobox it's validate is not performed. Also if I back tab in the combo box it does not return to the text box but goes off to another control on the screen. If I take out the disabling of the text box everything is fine. Beats...
3
3805
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76) and they were put onto the form in the numerical sequence. I have given the A's with B & C's on the same line a tag=1; B.tag=2, C,tag=2) I am trying to write 2 modules so that the following occurs (on Form_Current and 'A' Control_Before or...
5
2606
by: Greg Dunn | last post by:
I have two tables in a parent-child relationship. Details on the tables are as shown below: Table1 ------- Item_ID (primary key) Item_Owner (foreign key to Table2) Table2 -------
3
1684
by: Ivan V via DotNetMonster.com | last post by:
Hi All: I would like to know if I can loop my selection in a combobox. For instance, I got 8 items in a combobox, and when I selected it using the up and down arrow, it will stop in the first record even I keep on press the up arrow, on the other hand, if it's the last selection, it will stop in the last record even I keep on press the down arrow. Is there any way that if I keep on press the up or down arrow, the slection in it will keep...
6
2885
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
0
4010
by: vnaz235 | last post by:
Hi, guys, 1. Can anybody help me to populate ComboBox on VB6 form with a) text strings from the range on the already existing Excel sheet (e.g., Workbook("Test1").Sheets("Sheet1").Range("P12:P72")) and another ComboBox with b) names of visible Excel sheets in the same workbook? 2. How to pass selected items from ComboBox1 into Workbook("Test1").Sheets("Sheet1").Range("A1") and from ComboBox2 into...
0
1214
by: evlpupy | last post by:
Good Afternoon I have need of assistance for programming a visual basic form in excel. In excel I have 3 named ranges TM Agents1 Agents2 In the TM range I have 5 different names of managers (ie Tom Smith, Bob Green, etc.)
0
1368
by: Manikandan | last post by:
Hi, I'm working with .NET framework 1.1 I'm manipulating a excel file using Microsoft Excel 9.0 Object Library. Reading and writing to ordinary cells in excel are fine. I have a excel file, it is protected, I need to feed some data to cells and get the result from a cell in that excel file I'm having a combobox in excel sheet, I don't know how to select the item in excel file from c# application. Kindly help me to select an item from...
26
20195
by: JFKJr | last post by:
Hello everyone, I have added a ComboBox in excel spreadsheet using the following Access VBA code. Public eXL As New eventsXL Function Create_ComboBox() With eXL If .XL Is Nothing Then Set .XL = New Excel.Application .XL.Visible = True
0
2029
by: wizofoz777 | last post by:
Ok here is my problem : I was creating comboboxes and I wanted to be able to use the same event for all of them. So I decided to create a combobox collection containing the event in a wrapper. When testing this part was working fine til I decided to add the creation of these combobox. So when I am dynamically creating these combobox, it is no longer triggering my wrapper event but if I only use a loop to affect every combobox objects to my class...
0
9904
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
11051
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10693
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10378
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5756
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5956
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4170
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3196
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.