Input Box: Return 2 Values To 1 Cell
Jan 30, 2008
I am attempting to have a user enter a First Name into the first Input Box and a Last Name into the second Input Box.
Within the code, I would like both answers to be returned to cell A1.
For example: A1 would read as Doe, James or James Doe (any variation is fine, as long as its one value in A1).
Sub Name()
y = InputBox("Enter First Name", "Information")
If y = "" Then
MsgBox "You must enter", 16, "Message"
Else
x = InputBox("Enter Last Name", "Information")
If x = "" Then
MsgBox "You must enter", 16, "Message"
Else
Range("A1") = y & & x
End If
End If
End Sub
View 9 Replies
ADVERTISEMENT
Apr 5, 2008
I've created a userform that has one ComboBox (ComboBox1) and two text fields. I am trying to get the userform to return information to my worksheet in the same row as the name that is displayed in the ComboBox. This is my VBA code.
Private Sub Cmdpayment_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Sheet4
iRow = Cells. Find(What:=Me.ComboBox1.Value, After:=C5, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ws.Cells(iRow, 12).Value = Me.txtpdate.Value
ws.Cells(iRow, 13).Value = Me.txtpayment.Value
Me.txtpdate.Value = ""
Me.txtpayment.Value = ""
End Sub
View 8 Replies
View Related
Apr 1, 2014
For example i input in cell A1 April 1, 2014 in cell A2 it must put Tuesday.
View 2 Replies
View Related
Jul 25, 2014
I get a text file daily for routed deliveries containing a barcode, name, address and phone number that I convert into csv and then upload it into a route optimization software. after optimization is complete it has assigned packages to drivers and I export it to excel and print. My sorters are having a difficult time reading the addresses on the packages and assigning them to the proper driver, so I am trying to come up with a way.
My idea is that I can import the barcode as a custom field into the route optimizer and then when I export it, that barcode field will still be associated to that order. I want to scan the barcodes of the package into column C which will reference all of the barcodes in B and when it finds the match, it will return the value in A, the driver assigned to that particular package. This way my sorter will just have to scan the packages and throw it into the proper bag for the driver instead of having to visually scan the printed manifest to match.
View 2 Replies
View Related
Nov 25, 2013
I want to return the data from a list in a cell on worksheet1 if I input a variable on worksheet2. I need to avoid VBA and pivot tables.
Example, if I put "Expense" in the input cell on worksheet2, I want to return a list of each row that has "Expense" in it on worksheet1:
Worksheet 1 (ColumnA/ColumnB):
Revenue/45,000
Expense/20,000
Asset/43,000
Liability/21,000
Revenue/6,000
Expense/9,000
Expense/11,000
Liability/13,000
Worksheet 2 required output (no row gaps or spaces):
Input cell "Expense" - in A1
List required (A3:B5):
Expense/20,000
Expense/9,000
Expense/11,000
View 9 Replies
View Related
May 19, 2009
I need some code to use text boxes to change the data in certain cells. Basically I want 3 text boxes to appear one after another. The first box should add text to cell T1, then 2nd to cell T2 and the 3rd will add text to cell T3. All these values should be added at numbers.
View 2 Replies
View Related
Apr 2, 2007
I want to tie the values of some cells on Sheet 2 to what's put in into corresponding cells on Sheet 1. Example
If Cell B3 on Sheet 1 has the string "B off" put in, Sheet 2 should automatically get "R1" in cell B12, "B off" in cell C12 and "ID123456" in cell D12. If cell B3 on Sheet 1 is empty, B12:D12 should be blank.
View 4 Replies
View Related
Dec 4, 2009
I have lot of data in three columns like this. The first column is "Name", the second is "Comment" wherein I want the macro to write some comment, the third one is DOB. The problem is that the names in column 1 repeats many times. I want a macro to write in column B "either Old or Older or Oldest" based on the Name and DOB. Thus David with DOB 13 Sep 1982 be marked Oldest in Column B and David with DOB 25 Aug 1988 be marked Older and David with DOB 24 May 1990 be marked Old. Similarly William and Rita should be marked either old or older or oldest. As the data are enormous I do not want to refer the actual name in the programming. I want to call them using a variable in programming.
NameComment DOB
David 25 August 1988
David 13 September 1982
David 24 May 1990
William 24 March 1980
William 25 July 1987
William 13 August 1989
Rita 17 July 1990
Rita 24 April 1989
Rita 13 June 1988
The example file is attached
View 14 Replies
View Related
Sep 12, 2013
I want to create a macro that creates a new .xlsx document based on cell values. And input 4 tabs into each document with specified tab names. I have a document that pulls from external sources and fluctuates with amount of data per day. I envision something that will make a new document named for the contents in cell A1, then function as a control+down to create a new document for A2, then A3 until there is no content left (should mention these are lookup formulas, and if there is no data it pulls a value of "0")
Is there a way to put in the code, the tab names it would create in each new document, or would that have to look to a cell value for the naming? The tab names would be "GS", "MYSS", "COLL SHEET", and "WIRE".
View 1 Replies
View Related
Jun 24, 2013
I have a simple spreadsheet of an inventory. Each row on this spreadsheet represents the data related to an item. I would like for a user to be able to INPUT a serial number via a userform. Then, I would like for the program to OUTPUT some information about that particular item (a few cells that should be on the same row as the serial number).
I attached an image diagram that may better represent what I am trying to do.
View 9 Replies
View Related
Jan 7, 2009
If I have, in one cell (call it D1):
EH,DR,HU
and in a lookup table on another sheet:
A B
1 ED T
2 EH F
3 DR G
4 HU H
5 SE E
6 YU E
I need to be able to lookup the values in D1 on the table and return the values in column B to a single cell (say E1), also comma separated...
eg...
F,G,H
View 9 Replies
View Related
Nov 19, 2013
At work I have a spread sheet that I used to track material shortages by part number. So in column A of the spread sheet there is a list of part numbers that have shortages, column E contains a list of all sales orders that are affected by the shortage separated by a comma. I am trying to setup a query sheet where I input a sales order and get back a list of parts that are short for that sales order(basically reversing the original list to be by sales order instead of part number). The number of values in column E varies, sometimes a cell will have 1 value, sometimes 20+ and anywhere in between.
Example Sheet:
A
B
C
D
E
123
012
234
789, 567
465
789
890
012
I'm already got a INDEX/MATCH that would show both shortages for sales order 012. But I can not figure out how to get the shortages for 789 or 567.
View 1 Replies
View Related
Apr 5, 2007
In cell A2 I want to enter a day of the week and have other cells use that as a reference to return data to its cell. E.,g
View 9 Replies
View Related
Oct 17, 2011
I seem to be incapable of creating an array to return all of the values in each of the cells in the first row so that I can populate a combo box. I managed to do it without a problem for copying the sheet names within a workbook but not for this and I want to bang my head against the wall!
Basically, I have the first row of my spreadsheet for which I don't know how many columns contain data so my range is variable.
I then need to take the value of each cell and add it to my combo box (Later I would also like to use this routine to create and append sheets in other workbooks).
View 5 Replies
View Related
Jun 11, 2014
Let's say i got something like this
A B C D Result
200 250 Apple 600 Melon
251 450 Orange 225 Apple
451 700 Melon 325 Orange
751 900 Grape 457 Melon
So based on my example above, I have those data from column A to column D Now, how do I check if the value from column D belong to which category from column C based on the column A and B?
225 -> 200~250 -> Apple
325 -> 251~450 -> Orange
etc.
The result will appear on "Result" Column
View 4 Replies
View Related
Aug 4, 2008
I'm quite new in VBA and it can become a painful process to complete a working code. What I'm working on is a small process which looks up in individual cells within a range (ccy), for a particular value (EUR or USD) and if it finds that value, another cell in the same row with the value found is entered a certain text. What I wrote is:
Dim ccy As Range
Dim zone As Range
Dim i As Integer ...
View 7 Replies
View Related
Feb 22, 2014
I have a spreadsheet with 5 columns. A1 to A5
Entries are made into columns A2 to A5 but only ever one entry across all cells
If an entry is made into A2 to A5 the I need a "P" to be placed into A1
View 4 Replies
View Related
Jul 24, 2014
I am trying to create a macro which gives me an input box. I need to enter 2 numbers into the input box. It would be as follows:
Input Box Msg 1 - "What is your labor cost?" (NUM1)
Input Box Msg 2 - "What is your productivity rate?" (NUM2)
Then I need the macro to take this info and enter it into a formula which changes according to the row which you are on. (I need the macro to work based on which ever cell I currently have selected). The formula would be this if I currently had a cell on row 10 selected:
=(NUM1*(NUM2*$H10))/$H10
So, if I currently had cell L10 selected, and I ran the macro and put 100 in for "NUM1" and 10 for "NUM2" and my sheet had 20 in cell H10, then the macro would enter the number 1,000 into cell L10. If I had L500 selected, then the macro would enter the final number into cell L500 based on what value H500 contained.
View 9 Replies
View Related
Oct 9, 2013
I have a spreadsheet with 2 different sheets (DB and Workings). What i am trying to do is using VBA code is, need to match the state name CT from workings sheets (cell C3) with DB sheet of column B4 to B9 and return the Team values from column A4 to A9 in the row 4 (C4 to E4) of the Workings tabs (highlighted in Red) and similarly for the state name LA i want this process to get repeated.
View 4 Replies
View Related
Jan 20, 2014
I am wanting to use a vlookup or perhaps an array(?) to bring through multiple cell values based on being the maximum value. So say there are multiple employees (all with unique ids) under one manager (also with unique ID), I want to find the employee with the highest value in a particular column and return that employees details, such as name, employee number and the value itself, which are all in the same row. I have attached a basic example of the data involved.
View 8 Replies
View Related
Oct 21, 2009
I basically have this worksheet which has Cell D3 Being Dynamic. It puts the lowest cost supplier from columns H:W. If i change the prices in H:W it will bring up the lowest cost supplier in D3. Once D3 is chosen i want it to self populate F3 and G3 based off of what is in D3. This data should be pulled off from what is in the H:W columnns corresponding to the supplier in D3.
View 3 Replies
View Related
Feb 15, 2010
I tried searching for a solution to my formula problem in this forum regarding vlookup and saw similar formula e.i returning multiple values but it doesn't cater with what I need.
Vlook is returning only the first value but what I need is to return all the multiple return values in 1 cell. I've attached a sample worksheet for reference.
View 7 Replies
View Related
Nov 28, 2012
I am trying to put together a calculation sheet for court costs and I need a cell to return a value based on the amount entered in another cell. For example, if I input a value between 1 and 5 in cell A1, I would like "Cat" to appear in cell A2. However, if I input a value between 6 and 10 in cell A1, I would like "Dog" to appear in cell A2. Is this something that can be done without VB?
For the real spreadsheet, I would need the following outputs in cell A2 based on the respective ranges in cell A1:
Output to A2 = $405 if input to A1 is < $50,000.
Output to A2 = $905 if input to A1 is ≥ $50,000 and < $250,000
Output to A2 = $1,905 if input to A1 is ≥ $250,000
View 3 Replies
View Related
Jan 7, 2010
I have two sheets - one work sheet and the second - database with existing entries. Going by visual example below, I need the column C of the work sheet to automatically populate with the data pulled from the database sheet. For example, C4 on the Work sheet should find both values "Bike" and "Green" in one row on Database sheet and return the corresponding value 44444 from F97. The work sheet cells in the row C should remain empty if no match found on the database sheet.
Sheet 1 (Work sheet)
-------A--------B---------C
1---Auto-----Red
2---Auto----Green
3---Bike-----Red
4---Bike----Green
5---Bike-----Blue
Sheet 2 (Database)
-------A--------B---------F
12---Auto---Red----11111
37---Auto--Green---22222
85---Bike----Red----33333
97---Bike---Green--44444
102--Bike---Blue----55555
View 2 Replies
View Related
Feb 23, 2012
OK for example if i hae this list of data:
Invoice number Order number
111 560
112 561
112 562
113 563
What i need to do is a vlookup from the above table to return the following:
Invoice Number Order number
111 560
112 561, 562
113 563
View 9 Replies
View Related
Jul 17, 2012
Traditionally the vookup will return the first value it can match. I can return multiple values on different lines using an array formula but this is not useful.
In the example below I have table array A1:B8. Lookup criteria in cell A11 and want to return MULTIPLE values from column B in cell B11.
I would prefer to not use VBA if possible
A
B
1
[Code]....
View 6 Replies
View Related
May 5, 2014
I am trying to return an array of values into 1 cell.
Basically, I have a gigantic list of item names, item numbers, and reuse codes.
I want to populate all the reuse codes by item number in a second sheet:
something like this:
Source sheet
Item item num Reuse code
Widget1 w001 298767
Widget2 w002 4894957
widget3 w003 28276
Widget1 w001 12345
Widget1 w001 678910
What I want this code/formula to do is consolidate the reuse codes based on the item number.
Aggregate Sheet
Item item num Reuse code
Widget1 w001 298767;12345;678910
Widget2 w002 4894957
widget3 w003 28276
I have this formula but it only gets the 1st Reuse code, I want it to get ALL reuse codes for that item.
{=INDEX('Reuse list '!$P$2:$P$24489,SMALL(IF('Reuse list '!$E$2:$E$24489='Status Sheet'!A11,ROW('Reuse list '!$E$2:$E$24489)-ROW('Reuse list '!$E$2)+1),1))}
View 2 Replies
View Related
Nov 21, 2007
I have in A1 a string of 100 characters..
I would like to create a SELECT CASE where,
if in A1 there is the word "BLACK" , put 1 in A10
if in A1 there is the word "WHITE", put 2 in A10
else put 50 in A10
I'm trying to use the instruction INSTR but with negative results..
(I have many cases other than BLACK and WHITE, that's why I need a SELECT CASE)
View 4 Replies
View Related
Feb 20, 2008
I have the following formula: =IF(C319<=300,9,IF(AND(C319>300,C319<500,6.75),IF(C319>500,6))) It returns 9 if C319<=300 but returns FALSE for all other numbers. I want the funtion to return 9 If <=300 and 6.75 if C319 is greater than 300 but <=500 and if it greater than 500 it should return 6.
View 5 Replies
View Related
Jun 8, 2014
I would like to know if it is possible to transfer values of cells this way?
I've attached the excel file for easier reference.
View 3 Replies
View Related