I have a listbox that has one or more (up to five) entries. each of these entries must then be represented by a variable. i set up msgboxes to make sure the right values are collected. but im getting back blanks!
For fLoop = 0 To .ListCount - 1
If .Selected(fLoop) Then
fUpper = fUpper + 1: Redim Preserve Boothlist(1 To fUpper)
Boothlist(fUpper) = .List(fLoop, 0)
For i = LBound(Boothlist) To UBound(Boothlist)
If i = 1 Then
Boothlist(i) = group1
I have 2 userforms. UF1 and UF2. UF2 has a rowsource set to its Listbox. UF1 has a search function that searches the original sheet. Now I want to double click on an entry in UF1's Listbox and select the same entry in UF2's Listbox. I want to then work with that entry in UF2.
I do all of this to circumvent Excels restriction. I can't search in a rowsource Listbox, but any edits done to my new Listbox wouldn't be made to the Excel sheet.
I have recently discovered the concatenate formula. Is it possible to include 2 variables with 1 constant entry. i.e. I wish to establish file names with 2 variables, e.g. 0051 and 1025 followed by a file extension, .EC0 - the file name being 00511025.EC0. The variables are in Excel columns. I can achieve the wanted result by establishing an extra column and copying .EC0 into every cell of that column; but I would prefer not to have that extra column in the completed Excel file.
I have a form control listbox, which is populated with filenames from a specific directory. When the user selects an entry I need that text to appear in a cell in the workbook. This is then concatenated with a folder path to open the file to copy and paste some data out into another workbook. I have tried...
Code: Sub GetWrbkbkname() Dim strlist As String strlist = Sheet1.Listbox18.Text Sheet1.Cells(1, 1) = strlist End Sub
But receive the method or data member not found error. The cell link property just returns the position in the list! I need the text!!
The only workound I could think of was populating a space in the SS with the directory contents and using the cell link value in a choose function to return the selected workbook name.
I have managed to set up a dynamic range called "Managers" which is held in a worksheet named "Lists" to validate entries in Col D of a worksheet named "PartTimeStaff" -
I also have 2 userforms which either add or delete managers names from the dynamic range, this all works well.
What I need to do when using the Delete form is to check that the managers name is not selected in any cell of Col D in the "PartTimeStaff" worksheet - this is to ensure the user has reassigned the records to another manager before deleting selected manager on ListBox1within this form.
The code which runs from a command button is below
Private Sub cmbDelete_Click()
Dim i As Integer Dim SelectionsIndex() As String Dim ArraySize As Integer Dim RowToDelete As String
Application.ScreenUpdating = False
With Sheet2 .Visible = True .Activate End With
Set ManagerStartRng = Range("A3")
Application.EnableEvents = False
If MsgBox("Are you sure you want to delete this manager?" & vbCr & vbCr & _ "This action cannot be undone!", vbQuestion + vbYesNoCancel, "Confirm Delete") = vbYes Then
I have searched the forum but can't find an answer to my problem. I have a list of about 3000 streets, a sample of which follows:
ARBROATH ST ARCOLA ST ARGO PL ARIES PL ARMSTRONG AVE ARTHUR AVE ARVIN CT ASHGROVE CR ASHLEY GROVE CT ASHWORTH AVE...................
I know how to populate a List Box, but rather than having to scroll through the entire lot I would like to just have to type in a few letters and the output only display streets that start with only those letters. For example, if I type in AS only the following appear in the listbox.
ASHGROVE CR ASHLEY GROVE CT ASHWORTH AVE........................
I am having a sheet where I keep track of when online surveys have been sent to users. The users enail address (column K) may be on the list for several times, but I need to make sure that there is at least a 7 days pause between sending the first mail and the second, depending on the visit date (column G).If there are less than 7 days between two entries with the same email address, the user is not qualified for taking another survey.
I was thinking to write an IF formula which returns either 1 or 0 and then let conditional formatting highlight and HIDE the row via a VBA loop.
Is there a formula that will allow me to look for the existence of any number value in a row of one worksheet and then return a specific number value in a cell on another worksheet? For example, if the formula finds any number value it will always return the number 15 to a cell on another worksheet.
I used a form with textboxes for data input for one of my vb macros. Currently I have the private sub from the form transfer those entries to a remote cell on the spreadsheet, (like in column "HZ"), so that the macro that will actually utilize them can retrieve them. Is there a way to pass that data directly from what is entered in the form in the textboxes to the macro that will actually use them?
List 1 (TV Brand) Sony LG Samsung Depended List 2 (Models) Sony LG Samsung EX420 55EB9600 PL43E450A1FXZP EX430 77EC9800 PL43E490B4FXZP EX550 55EA8800 PL43E400U1FXZP EX520 KN55S9C UN32EH5300FXZP EX645 55EA9800 PL64E8000GFXZP
I'm using two Listboxes (Form Control) with multiple selection options namely Listbox 1 (Brand) & Listbox 2 (Models). I want listbox 2 input range to be depended on selection made on Listbox 1 (Brand). For example, if user selects Sony then box2 should show only Sony's models and if user selects Sony & LG, box2 should show models for both Sony & LG.
I have a userform where I can select multiple items in a listbox and add them to another. I also have the ability to filter the first listbox to make finding items easier. The issue I am having concerns the clear filter button. As currently designed, the clear filter button will reset the initial listbox back to its default values. Ideally, I would like it to reset to the default values excluding those values that currently in the second listbox.
The entire code is below for reference, but it's the sub ClearFilter_Click that I am struggling with.
im trying to create a two column listbox that will transfer both columns to the listbox on the right and also transfer from the right to left currently right to left works but when I trasnfer from the left to right then the right to left only one column is moved.
I am looking to create a macro that will create a new sheet when data is added on a summary sheet. Example.
1. Summary sheet called "Variations" contains columns that will contain the information needed for new sheet (Columns A to D)
2. When data is entered on "Variations" sheet: Column B, then macro automatically creates new sheet renamed to e.g. VO1 (Number used on "Variations" tab) and is a copy of "Master" tab.
3. Data entered in Column A to D on "Variations" tab is automatically entered onto new sheet created (e.g VO1). Shown is blue on attached file. Additional data is updated on "VO1" sheet and this then links back to "Variations" tab
Can a Function give two or more output variables. e.g.
Sub a() x = 5 result = Y(x) End Sub
Function Y (x As Integer) As Integer Dim B B = ... * x Y = ... * B
this will give back Y as a result. But if I want to get 2 or more output variables (let's say I need to get also B into sub) from one function, how should I do that? I need this because function works with large matrix and I want to extract some values appeared in between.
I have the following sheet which functions as a table to store values for files that have been created using the application which this table is in. In this app., I have a form with 2 listboxes. When the form loads, I have the first listbox list values which each of these files are listed under (i.e. - "sub-directories"). With a selection of one of the list values and clicking of a button, I want the second list box to list the values of cells listed in a range directly below where the selected value in the first listbox came from.
I'd prefer, in the first listbox, to have only the values of the ranges that have a value in them in the listbox. However, this would cause my listbox.selected(array) not function properly. But since my current offsets (in the second sub) do not seem to be working anyway, maybe I am going about this totally wrong.
I have 1 listbox (lisbox1) that retrieve it's list items from a worksheet range (imported/database query from access). This works fine.
I have a second listbox (listbox2) that should display results from clicking a value in listbox1. Listbox1 contains companynames (1 column), listbox2 needs to be populated with quotes.
Range A3:D4800 contains company ID's, Company names, Quote Numbers. When I select a company name in listbox1, I need listbox2 to be populated with all quotes for that company.
I have tried (using vba) to do a vlookup using the listbox1 value, but I cannot seem to figure out how to populate listbox2 with "all" quotes. I get 1 quote and that's it. I realize I probably need to have the vlookup loop through each cell in the range to find the value, but when I try this, I get a type mismatch when using the .additem (only for the 2nd and subsequent passes).
I cannot find this information anywhere else in this forum...
Does anybody know how to transfer an item from one list box to another using code, on the click of a button. The list box with the information in is called 'Team_ListBox'The list box i am wanting to transfer to is called 'Starting_Team_ListBox'The button to do this task is called 'AddPlayer_team_Btn'
I'm trying to loop through a range in excel from access, checking where the titles (in Excel row 1) match with the fields (in a recordset in Access that is passed to the function) - and where they do, I want to dimension a variable to hold the column number - I'm not sure it's possible, but I'd be interested to know either way. The line I'm asking about is at the bottom of the code - the rest of the code is just to give context...
Sub ImportGeneric(rsImported As ADODB.Recordset, rsConfirmed As ADODB.Recordset) Dim fd As FileDialog Dim xl As New Excel.Application Dim wb As Excel.Workbook Dim ws As Worksheet Dim iFilePicked As Integer Dim strFilePath As String fd.Filters.clear fd.Filters.Add "Excel files", "*.xls" fd.ButtonName = "Select" iFilePicked = fd.Show If iFilePicked = -1 Then strFilePath = fd.SelectedItems(1) Else ..................
but i need to have it split in to individual cells so
Cell A1 would be 101 hampton court B2 Hampton Heath C2 Hampton Town D3 Hamptonshire E5 HA01 1AS
each part of the address is split by a comma, so i have tried to use that as a identifier as to where that part of the address is, but failed on that, i can separate out the first part and the post code with a find and replace but not the middle.
also i need it to work backwards ie
it finds the post code first,
then the county
then the town
as those 3 are always the last 3 parts, but the address could only have 1 line of addres beofre the town or 3, and it would get messed up as all the post codes, county ans town needs to be in their respective columns
I have two listboxes on a userform. One is the "choice" listbox, the other is the "master" listbox. Each item selected is a billing object on a sales invoice. problem: The master list works fine when the item is selected in the choice list. But when it is deselected, how can you REMOVE it from the master list? question: How can I add a text box automatically to the userform to allow the user to enter quantity info?
For I = 0 To CodeList.ListCount - 1 If CodeList.Selected(I) = True Then obj = CodeList.Column(0, I) p = 6 test = 0
Do While test = 0 And p <= 25 If sheetsales. Range("C" & p) = obj Then test = 1 Else test = 0 End If p = p + 1 Loop If test = 0 Then.........................
i have a "problem" to empty / reset my variables. I defined them as vHour1_KW2 where the "1" is from 1 to 21 and the "2" starts from 1 to 53. Now I want to erase all of this variables or to set the value of them to "0". At moment I use following