473,686 Members | 2,085 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 2492
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
4013
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
3794
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
2601
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
1678
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
2878
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
4003
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
1198
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
1364
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
20163
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
2016
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
9057
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
8934
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...
1
8770
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8780
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
7603
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4309
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
4534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2947
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
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.