VB: 'enables user to click [U]highlight and select[/U] an item in ListBox1 and ListBox2 item (same row in index) is also [U]highlighted[/U] (highlighted only not selected) Private Sub ListBox1_Click() ListBox2.ListIndex = ListBox1.ListIndex End Sub
Question: Is it also possible to enable a user to click to select an item in ListBox1 and ListBox2 item is also selected simultaneously (same row in index). Is there excel vb code to do this?
I think the code may be along the lines of the ListBox SelectedIndex property. What would be the Excel VB code equivilant for the ListBox SelectedIndex property, if so?
I have a list of 20 cities in K1:20 and they can be selected from a drop down menu in column A2:A22. I want then to randomly pick 6 out of 20 and these 6 cities must to appear in a line A1, B1, C1, D1, F1, and G1
On cell A1 I have used the
IF ( A2=K1,K1, IF(A3=K1,K1...................A22=K1,K1,IF(A2=K2,K2......A22=K3,K3)
It seem to be an endless formula is there another way to make it easy ???
I am trying to see if there is a way using count or another option, of using one formula to look in a column and then spit out how many of each item are there:
i.e: lets say it says a, b, c, d etc...
Can a formula go through and say you have 3 of a, 5 of b and so on
I understand the basic of count sum iserror etc, just not sure if excel can do what I am wanting or if i should use access.
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 would like to put a formula (or make a macro) for Cell F7 (and all the other cells too) in sheet "Budget Sheet" that pulls the value $100 from cell G5 from sheet "Input Sheet" by looking through columns A-F for the account ID "5111100"
Obstacles:
- I (for the most part) cannot change the format of "Budget Sheet" or "Input Sheet"
- I cannot have the formula (or macro) just look down Column F because the actual file I am working with has the pertinent account IDs scattered through columns D-F (it was exported from another program).
Notes: - I am using Excel 2003 SP3 - If necessary, I can make the reference to "5111100 · Bonus" if that would make things simpler
- Column G will always contain the dollar amount I need.
-I've been hitting the books trying to figure out how to get array formula working on this and cannot for the life of me get it to obey when I press ctrl-shift-enter.
I have Useform1 & Textbox1 & Textbox2 & CommandButton1
*Textbox1 = Identifier where to put the "X" mark when data is found *TextBox2 = The User Data 'It is a multiline textbox *CommandButton1 = Execute the macro *Excel Column "B3" = Where the textbox2 data will be compared. this one has default data. *Excel Row 2 = the identifier where to put the "X" mark when the data is found.
The user will enter data in textbox2, For each TextBox2 Value it will be compared in the Data in Column B3 only If the Textbox1 Value found in Row2 which has the codes. Then when the Value is found. it will mark with "X" in the column where the TextBox1 value found. see my screenshot.
I need some way that can identify when the item in the description column doesnt match the first item of the same number- for example, here the 1-blue and 3-orange would be flagged because they should match the 1-yellow and 3-green.
I need to do this on a much larger scale (approximately 20,000 data points), so I wanted to create a formula or macro that could do this for me.. I thought making a reference page with would work but I keep getting an error.. I haven't done VBA in a while, so I may have syntax errors.
If Range("A2:A9").Sheets("Sheet1") = Range("A2:A6").Sheets("Ref") And Range("B2:B9").Sheets("Sheet1") = Range("B2:B6").Sheets("Ref") Then Range("C2:C9").Sheets("Sheet1") = "x" End If
I am getting close to finishing the drop down menu capability when filling in column L in tab Transactions. However, there is a snag. When I enter part of account say "fin" (the important part here is that the part of the word should not be the beginning of the account name) - then I select an account from the menu - but it does not stay in the cell if the part of the name is the beginning of the account name - all is fine.
I have a spread sheet for equipment that gets loaned out on a regular basis. Cells B4 - B25 have combo boxes in them, with the options to select "On Loan", "In Stock Room" etc in them. What I would like to do is create something so that as the combo box is changed, i.e. from "In Stock" to "On Loan", a date changes adjacent to each combo box.
For example, combo box in B10 has been changed from "In Stock" to "On Loan". The adjacent cell records the date automatically that the combo box was changed.
I have a dropdown list in C24:C50 (=CategoryList) with data validation and a sub list in D24:D50 (=ItemList) with data validation. I am looking for a way to have code automatically run after selecting an item in the data validation dropdown list in column C.
Example; I click on C24 and make a selection. I what it to trigger code that would move me to D24 and open up the data validation list in D24. After the selection in D24 I would like it to move me back and down 1 row to C25. I have not found anything directly related to this but I have found that code can be run after a selection in a valadition list.
I am using a vlookup and have a problem. I am assigning a category to an item number based on the first two characters of the item number. For example item number 60123 would equal scrap because of the first two characters of 60. But the item number can begin with either a number or letter. Here is the formula I am using that works for item numbers that begin with numbers:
=VLOOKUP(VALUE(LEFT(E2,2)),Sheet3!A:B,2,FALSE)
It works fine until I reach a item number that begins with a letter, then I get the dreaded #Value error. If I take the value out of the formula then it works for the letter based number items but not for the number based item numbers.
Here I would like to get your valued guidance for the usage of "IF" formula. I am having two sheets one is new XL-1 and other is old XL-2. I want to have a item number from the old file corresponding to the same item descprition in the new file. I am attaching the snap shots of two files which is more explanatory than describing in words here.
I have a sheet of addresses and have a column that indicates if I have shipped them something. I would like to populate the "shipped" column with an item name, then have excel pull the address onto a separate sheet if that column contains specific text. I tried the following formula:
=IF(ISTEXT(SEARCH("***",Sheet1!X2)),Sheet1!A2)
It currently is only returning FALSE even though X2 contains the word "**". Is there a way to have Excel return a cell's data instead of a TRUE/FALSE?
I am using Vlookup to compare our item number with the suppliers item number but the result is removing the decimal point on some but not all items.I have included a small sample but it concerns almost 10.000 items.
I have I workbook that contains 2 sheets. The first sheet "Business Objects" is the master list. The second sheet "Gene" contains similar data but is incomplete. There is a unique identifer for both sheets and that is item ID. what I would like to do is look at the Item ID column on sheet1 compare it to SS# on sheet two and copy any rows from sheet1 to the end of the sheet in sheet 2. I have found in my searches on this forum a bit of code that identifies the ones in sheet1 that are not in Sheet2 and highlights them red(which is not neccessary for me, but I am struggling to figure out how to take that and paste it to sheet2.
how I can, in a formulae, identify the last item(s) in a list of values. For example I have data in rows 1-25 with numeric data in. I want to put a formula in, say, row 100 that averages the last three data items above in the same column, but the number of data items will increase over time to use row 26, 27, etc. and I don't want to change the formula in row 100.
I am trying to find the std dev for each items below. I have tried to look for online tutorials but all tutorials I have seen only teach me to do a std dev for 1 set of item.
I need a macro to add the last 2 items in column G, if they are both positive or negative. If one of the values is either positive or negative, then they must be subtracted.
In the example below the formula in G45 = G43+G44
The data is imported so the range will allways change foe rg G45 must become G75, then the formula will be G73+G74 if they are either both postive or negative or if either one is positive and the other is negative then G73-G74 ....
I have a combo box(form control) and have it populated with data.
I want each item to do something so that when one is selected it triggers and event.
the items are:
Rounds 1 - 5 Rounds 6 - 10 Rounds 11 - 15...just like that all the way to 30
the worksheets are labeled "Rd 1", "Rd 2", "Rd 3" ...etc
When I click "Rounds 1 - 5" in the combo box, besides the "Summary" worksheet (which is where the combo box resides) only "Rd 1 - Rd 5" should be visible, I want all other sheets hidden, and when I click "Rounds 6 - 10" I want "Rd 6 - Rd 10" visible and all else hidden.
how I can match an item in a row with another row?
I have a row of data A2:J2. A persons name could be in any column in that row.
I have another two rows of data where the peoples name and department name appear Where L2:L7 = peoples names where M2:M7 = peoples department
I want to match a name in A2:J2 with one in L2:L7 and if matched put the department name in K2. Then obiviously i will copy the formular down column K.
I have a list that kind of looks like this. I sorted it by date, then by location, and then by time. I need to find the earliest item in one location on a given day and display as a list.
When copying the formula =SUMIFS(G3:G103,I3:I103,"3") how do I modify it so that only the "3" rolls to the next integer and the rest of the formula remains constant? In other words the 3 would roll to a 4 when copied down a column and the rest of the formula does not change?