473,915 Members | 5,813 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 2503
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
4023
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
3807
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
2608
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
1687
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
2886
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
4016
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
1216
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
1369
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
20203
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
2033
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
10039
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
9881
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11066
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
10542
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
9732
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
7256
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5943
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
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4778
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

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.