Concat Function: Merge 2 Column Together
Oct 29, 2008how can merge 2 column together:
column time1 with text as 00:41
column time2 with text as 27
how can i merge it into a single cell in hh:mm:ss format , 00:41:27 ?
how can merge 2 column together:
column time1 with text as 00:41
column time2 with text as 27
how can i merge it into a single cell in hh:mm:ss format , 00:41:27 ?
I found a small routine on msn that combines two olumns in a third. It works well.
Here it is.
Sub ConcatColumns()
Do While ActiveCell "" 'Loops until the active cell is blank.
'The "&" must have a space on both sides or it will be
'treated as a variable type of long integer.
ActiveCell.Offset(0, 1).FormulaR1C1 = _
ActiveCell.Offset(0, -1) & " " & ActiveCell.Offset(0, 0)
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Here is my question. I need to alter this routine so that the macro will start at A1 and move to right until it finds its first empty cell and the combine all the strings of the cells it moved past.
I would like a macro to invoke after selecting multiple rows that would be concatenated into a single row containing no dupes within each column of selected cells.
Details:
I would like to select '2 to n' rows. I would like the macro to concatenate the cells of the columns only within the selected range. However, if any of those cells are duplicates or blanks, I don't want them included in the concatenated cell. After the concatenation of all selected rows is complete, I'd like the macro to delete all the selected rows, except for the final concatenated row.
[NOTE: Rows 3 and 4 (below) would have been deleted by the macro.
Row 8 would become the final product in row 2's place.]
******** ******************** ************************************************************************>Microsoft Excel - Book1___Running: 11.0 : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutA1=
ABCDEF1Sample*Data:*****2aaaxxxflintstone,*fredXYthese*are*notes3aaaxxyrubble,*barney*N*4aaaxyz*X*add*notes5******6******7Desired*Output:*****8aaaxxx
xxy
xyzflintstone,*fred
rubble,*barneyXY
Nthese*are*notes
add*notesSheet1*
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
I need to concatenate and de-dupe. I want to find dupes, concatenate a column, and the delete the duplicate columns--all while maintaining data from other populated columns.
Here is the some example data:
#| Type | Name
1 | A | Bob
1 | B | Bob
1 | C | Bob
2 | B | Sally
2 | E | Sally
3 | A | Bill
3 | C | Bill
4 | E | Nancy
The result should look like:
# | Type | Name
1 | A, B, C | Bob
2 | B, E | Sally
3 | A, C | Bill
4 | E | Nancy
I am using Excel 2003.
I've used vlookup before but his #REF problem has me stumped.
I want to concat two cells in the Source worksheet and vlookup into the Defs sheet, but I keep getting #REF(G4:G6) when I want to return the 2nd column in the Defs sheet. What's curious is when I modify the vlookup to return the 1st column I correctly get the lookup cells(G6:G9).
What's wrong with the formula in G4.
My requirement is I can't change the format of the Source worksheet because it contains macros that work with ERwin. And it is MUCH bigger than the attached sample so I will copy/paste the formula down 6000+ cells.
I try to merge two sting (one from function). the output of the following sub should be "ttgood". but instead, i got "good" only.
Code:
Function cs()
Dim sv As String
sv = "tt"
End Function
Sub ts()
Dim s As String
s = sv & "good"
MsgBox s
End Sub
I've succesfully managed to get the mail merge functioning from within Excel at the press of a button. I had a problem initially Word not shutting down properly but have solved this.
The problem I have now is that after the merge has finished and the spreadsheet is saved/closed and Excel is closed, the process tab in Task Manager says that Excel is still running. I found other instances on the net in other forums of people having a similar issue but alas no solutions. The full code for the procedure is below:
Private Sub cbMerge_Click()
Dim wrd As Word.Application
Dim mydoc As Word.Document
Dim lastrow As Long
Set wrd = CreateObject("Word.Application")
wrd.Visible = True
Set mydoc = wrd.Documents.Open("U:TSD3-Projects11-CBRNCBRN-036-CVF HVAC Main Contract-T13212-WorkingECR FolderTESTINGEQR Test.doc")
With wrd.ActiveDocument.MailMerge
.OpenDataSource Name:= _
"U:TSD3-Projects11-CBRNCBRN-036-CVF HVAC Main Contract-T13212-WorkingECR FolderTESTINGECR Log TESTING.xls", _..................................
I have a worksheet with 10000 plus entries in ten columns From K to T. I wish to have a macro with Concatenate function to merge certain Columns from these ten columns, in one column with help of input boxes which may ask inputs, about range (from and to ), and number of digits to concatenate in the required column. I use Excel 2003 XP in work but an example is 2007 attached.
View 5 Replies View RelatedI am looking for function which allows me to merge and sum values in rows with same ID.
Example:
Sheet1
Sheet2
ID
Value
ID
Value
1.1
1
1.1
4
[Code] ........
Ordinarily I would use a Pivot Table and GetPivotData function, which can easily do this calculation, but in this case file I work with is shared, so Pivot Tables do not work. Unfortunately I am not skilled enough to type my own VBA function. New rows are added to the data source (sheet1) every day...
I am trying to get excel to search a workbook/(or worksheet if easier) for a matching unique value and fill in its associated data. My first workbook has the SKU (A) filled in but not the UPC (B). My second workbook has both the SKU (A) and the matching UPC (C) filled in.
I need to take both workbooks/(worksheets), compare the SKUs, and if a matching SKU is found, extract the UPC from Workbook 2 and fill in the UPC field in Workbook 1, and if no UPC is present in Workbook 2, then it leaves the cell in Workbook 1 blank.
I have been using the CONCATENATE function to merge 2 strings together into a single cell. However the problem is, the third concatenated cell depends on the other 2 existing. The idea is I want to take 2 columns of data, and use a formula to merge them, then delete the original 2 data columns so I have a single column with the full data merged.
COL 1 (A3) = First Name
COL 2 (B3) = Last Name
COL 3 (C3) = Full Name (wanted)
So I do =CONCATENATE(A3,B3) and that puts the fullname in C3, but I want to sort of "flatten" C3 so that I have the fullname by itself and I can delete the original cells (A, and B)
On sheet 1 I have a list of 1000 firstnames
On sheet 2 I have a list of 1000 emails,
I need a function that states If a cell in the email column contains a string or value from the names column, it will result in a true statement so that I can separate out the emails that have these peoples first names.
I have two columns that are the same field, both Middle Name. The first column does not have every single row filled and the second column has every row the first column does not have and vice versa. I want to merge them to one filled column.
View 2 Replies View RelatedBasically, I need to merge the values in row A into specific rows in column D (as indicated by A1, A2, A3 etc).
View 6 Replies View RelatedI want to merge cell text from different column's and row's into a empty cell using VBA and array. e.g (fName, lName, address, City)
I have seen many way's to merge cell text from same row.
I have hundreds and hundreds of excel files. but in every file, there is the same column lets say column D which has all the information I want. In stead of opening hundreds of worksheets and copying and pasting over the data into a new sheet. Is there a code I could write that would open all these files and copy the data from the same colum over into my new sheet? so column D in the first work book will copy to colulm A in the new work book. Then colum D in the second workboko will copy to the new worksheet in column B ect ect ect.
When I use "Merge & Center cells with Labels" of a pivot table, It is merging Column labels as well as row labels. Is there a workaround to apply this feature only for column labels and not for row labels.
View 2 Replies View RelatedI have 2 columns full of information feeding from 2 different sources on our internet database
I would like to collect this information into 1 column to create a drop down list
As these are expanding tables feeding from the internet I don't think copy and paste into one column will work (I'm not sure about this but I would prefer a formula to avoid any issues).
I have got a wordlist in worksheet "original" which looks like:
Before: [Code] .....
I need a macro which merges the columns B,C,D,E and F depending on if there are duplicates in Column A or not. If there are one two or more duplicates in column A,then those should be deleted and only one of them should remain in column A. The members of deleted duplicates in column B,C,D,E and F should be merged together. No duplicates should be made by the process of merging. Each member in column B,C,D,E and F has to be unique. The results are supposed to be put in worksheet "new".Columns B,C,E and F should be merged through signe "/". And Column D should be merged through signe ",".
After: [Code] ......
The macro must be able to deal with very large lists. biger than 200 000 words in column A
Here is the excel file containing the example : excel file
Now I know that merging cells is usually not a good thing in VBA, but I'm working on a data report that just looks bad unless longer pieces of text can span several cells to minimize column width.
So here's the problem:
I have a column of 1's and 0's in columns E and F, and text in Column G. I want to merge the cells in columns G and H for that specific row if there is a 1 in either the E or F column for that specific row. And I need to do this for a long range...rows 7-5000. Any ways that VBA can do this?
i have got a wordlist in worksheet "original" which looks like:
Before:
i have to clean a worksheet from duplicat rows. The list looks like:
A---------B-----------C
a---------s-----------b
a---------f------------b
a---------s-----------b
a---------e-----------d
a---------d-----------v
Those rows have to be deleted where duplicates exist in column A and C. In our example the first three rows would meet the criteria and two of them have to be deleted. Content of Column B has to be merged with ";" but without duplicates. The result would then look like:
A---------B-----------C
a---------s;f----------b
a---------e-----------d
a---------d-----------v
I know how to merge data in a CSV (see attachment) from 2 columns into a single cell using =A1&" | "&B2 so that A1 (Safety Products) plus B1 (Fire Protection) becomes Safety Products | Fire Protection in cell C1, but how can I do this across multiple rows so that each pair of names is combined in each row? The job I'm working with is a product CSV file that has 6370 lines so I don't want to do them one line at a time!
View 2 Replies View RelatedIn a big data sometimes I have identical rows (maybe the 'Quantity' column has different value). I would like to merge them into one and add the quantities together. I have to use B and C (I need both) to find out if these rows are identical.
For example:
A1=date B1=111222 C1=ABCD ... and G1=quantity (1)
A2=date B2=111222 C2=ABC ... and G2=quantity (1)
A3=date B3=111222 C3=ABCD ... and G3=quantity (2)[code]......
I have data like Below Mentioned in column A and Column B.I Want to Merge
and Center the Data in Column based on column A.
For example; I want to Combine the Cell i.e b2 and b3,B4 to B7,No Need to merge B8 Because A8 have a Same name But Differnet City. and so no.
I need a Macro.I have 6000 data in one sheet.I have 18 Sheets like this
DEALER NAME
A M MOTORS MALLAPURAM8
A M MOTORS MALLAPURAM
AALIANZ AUTOMOBILES NEW DELHI7.35
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES NEW DELHI
AALIANZ AUTOMOBILES Noida15
ABHARAN MOTORS UDUPI7.88
ABT MARUTI CHENNAI7.89
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI
ABT MARUTI CHENNAI..................
I have a list of values, some are like values, others are not. is there a way to have the column to the right automatically merge the cells which have like information to their left. Attached is a sample file. I want to be able to have the cells in column B automatically merge based on the values in column A. I'm not sure if this can be done, but figured I would ask before I spend hours merging cells.
View 2 Replies View RelatedI have a couple of spreadsheets. all of them have a same or common column called "ID".
The order of the ID columns of the spreadsheets are not in the same order however.
I'd like to see if there is a way that I can merge the spreadsheets to one using the shared ID.
To explain more:
Spreadsheet1 columns are: "ID", "URL", "Location"
Spreadsheet2 columns are: "ID", "Picture"
Spreadsheet3 columns are: "ID", "Address"
As I said copy/past is not an option as the IDs are not in the same order. I need to create a new spreadsheeet and have all "ID", "URL", "Location", "Picture", "Address" in that spreadsheet.
I have a huge document that looks like this
Column A______Column B_____Column C
100/12__________B___________$
100/12______________________@
100/12______________________€
250/13______________________€
250/13______________________$
I want to keep in ColumnA all three rows of 100/12, because it has a value in Column B in one cell-which is the criteria, and remove the 250/13 because it has no value in cell B.
I was assuming that merging duplicates in column A, and than remove empty from ColumnB.
I am trying to select a range based on two variables which store the column numbers. what I have is:
View 4 Replies View RelatedI need to mine a huge spreadsheet of about 30,000 cells and make columns from specific words. As in.
I need to search for all words "table" even if the word is "My_table" or "aTable" and suck them into one column. I have to do this one several words.
Let me know if you have the solution. I am trying to write something but I am unsure of the syntax at this level.