Concatenate With Loop Through 2 Columns Of Information

May 28, 2014

I have a list of names with blank cells in Column A cell 2.

I want the programme to scroll through this column until it finds a name, when it does I want it to look in cell offset(1, 1), in this case B3 to see if there is a number. I want this number to be moved to offset (0, 1) AND any subsequent numbers below it until the next blank cell in that column (B).

In the attached image cell B2 will contain all numbers in cells B3:B9 with a / between them. Cell B10 will have number from B11 and B12 will have B13:B15. If there is no number it will just continue to the next name in column A. My rough code below delivered the first number only in the relevant cell and I'm not clever enough to get it right. It does not have to be super slick as it's for one time use.

I need numbers in column B cleared as they are concatenated into the single cell.

Spreadsheet.jpg

View 12 Replies


ADVERTISEMENT

Nested Loop To Concatenate 2 Columns Of Data

Oct 27, 2009

I think I just need a basic Nested For Loop code. I have a list of in column A, from A1:A537 and another list in column B, for B1:B50. I want to add a column that concatenates, each item in Column A to B1 (so 537 rows), then again each item in Column A to B2, another 537 rows, etc.. this loop is repeated 50 times, one for each name in column B.

View 3 Replies View Related

Concatenate Two Strings With Date Omitting Missing Information

Jun 26, 2014

I have the following formula:

=CONCATENATE("EXP: ",TEXT(AK2," MM/DD/YY")," ","VP DATE ",TEXT(AL2," MM/DD/YY"))

But if both cells are empty I get : EXP: VP DATE

If only one is empty, i get EXP: 08/26/19 VP DATE or EXP: VP DATE 06/27/14

But I do not want EXP: or VP Date text to show if the content of the AK# or AL# is empty. I figured I will place something like If(ak#="","",

But it give me a "Too many arguments" error.

View 4 Replies View Related

Using For Loop To Concatenate Cells

Apr 14, 2014

I'm trying to concatenate a few cells but seem to be missing the mark with my code. show me where I went wrong.

Code:

Dim counter As Long
Dim b As Range
Dim e As Range
Dim g As Range
Range("E1").Select 'Set the range for the loop
Selection.End(xlDown).Select

[code]....

View 5 Replies View Related

Concatenate 2 Columns & Delete Orginal Columns

Sep 25, 2007

I had wanted to go through my spreadsheet and concatenate two columns (A & B)into one (A) then delete the duplicate column (B), but have found no way to do that. Now I am trying to search then insert a column prior to the other two, concatenate the data into the new column then delete the columns. I am specifically having a problem with my Range statement and can't figure out how to activate it or discern it after using the Find command.

Sub GroupGender()
Cells.Find(What:="Group", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False _
, SearchFormat:=False).Activate
Selection.EntireColumn.Insert Shift:=xlToRight
With Range("a1", Cells(Rows.Count, 1).End(xlUp))
.Offset(0, 0) = "=RC[1] & "" "" & RC[2]"
.Offset(0, 2) = .Offset(4, 2).Value
End With
Cells.Select
Selection.Replace What:="Group Sex", Replacement:="Grp/Sx", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select.......................

View 4 Replies View Related

Loop Macro Which Downloads Historical Stock Information?

Feb 21, 2012

How to loop a macro which downloads historical stock information into Excel. I had the macro working for a single sheet, but I want it to update all of the sheets in the work book except a few. Now I keep getting a Error # 1004 unable to open error on line .Refresh BackgroundQuery:=False

Code:

Sub GetData()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
' Exclude certain sheets
If ws.Name "Porfolio" Or ws.Name "Benchmark" Then

[Code]....

QueryQuote:

With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, Destination:=DataSheet.Range("A5"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

[Code]....

View 1 Replies View Related

Copy Information From Variable Workbooks To Master File Then Loop?

Apr 30, 2014

What I have is a master file that needs to pull info from other sources (a simple copy and paste)
those files are called Inventory_xxxx.xlsm . Inside the master file, there are cells with the number of the inventory.

What i need is a way to tell excel to check what number is in the cell, open the files with that number, get the info from the files and paste it back in the master file... and the part that i consider the trickiest, a way to loop it.

For example, lets say i have 2248 in cell A10, it should open Inventory_2248.xlsm copy the contents from cell N4, O4, P4, Q4, R4 and S4(Inventory File) into N10,R10,S10,T10 and U10 (Master file) respectively then in A11, there could be a 2250 so it should open the 2250 file get the info, paste it and so on.....

Now I don't even know if this is do-able or just impossible, been fiddling with various codes to no avail.

View 4 Replies View Related

Match 2 Columns To Copy Information In Other Columns

Apr 21, 2007

I have 2 workbooks (workbook1 & workbook2). Information in column A and column N must match both workbooks per row/ cell (ie. if A2 and N2 in workbook1 match workbook2, copy information from 3 other columns (S, T, U from from workbook1 into workbook2 - cells S2, T2, U2). Workbook2 may have information in column S, T, U, but I need to over-write it with the information from workbook1. If the information does not match per that row/cell (ie. A2 in both worksheets are the same, but N2, they are not, so go to the next line that does match and copy the information into worksheet2). I do not want to use a V- lookup for this problem. I really need a marco.

View 3 Replies View Related

How To Concatenate Columns

May 16, 2012

I have the below set of data for example,

aaabbbcccdddeeeaaabbbaaabbbcccaaa

I need the output as,

aaabbbcccdddeeeaaabbbaaabbbcccaaa

As we know, a simple concatenate will work. But my columns are not limited and not easily countable. In my real scenario for some of the rows, data exist from column "A" till column "IB". So, I need to first identify the column data exist in each row and then to implement the concatenate function.

View 3 Replies View Related

Concatenate 3 Columns Into One

Jul 30, 2012

I'm trying to take the contents of 3 columns- A, B & C and have them form what I can use for a search string in column

D that I can use in a database I have.
Column A is first name
Column B is last name
Column C is Company Name

This is what i'm trying to get it to look like in column d:

("First Name Last Name" OR "FirstName.LastName") AND @companyname.com

View 6 Replies View Related

Concatenate Two Columns

Nov 21, 2006

writing a macro with following requirement

i need to display the third column with the concatinate values of column 1 and column 2

if A1 = Hi
B1 = All

then C1 should be Hi All

View 3 Replies View Related

Concatenate Columns

May 7, 2007

Item No amountinvoice no
2050377 14,870 105
5000085 120 1102
5000085 15,000 90197361
5000139 16,000 12346
5000237 31,000 56789
2050377 20,000 10111213
2050377 ($20,000)105

I have a spreadsheet with 3 columns. when I'm reimbursed money (see 2050377 for ($20,000) i'm trying to use VLOOKUP to search the spreadsheet and find out the invoice that relates to that reimbursement. but as you can see VLOOKUP finds the first incidence of 2050377 and gives me inv no 105 when it should be 10111213. my formula in C8 is =VLOOKUP (A8,$A$1:$C$8,3) but I need for the VLOOKUP to look at the item number as well as the amount. i've been told that I need to utilise concatenate, but I don't know how to do this.

View 4 Replies View Related

Concatenate Two Columns Of Text

Dec 25, 2008

In Excel 2007 I want to concatenate two columns of text. In Column A all the cells contain a single statement that I want to prefix the statements in the cells of column B (the statements in column B differ from cell to cell) I have used the formula =A1&" "&B1 and this is fine for that row, when I use the fill handle and pull it down the page the formula changes accordingly i.e.=A2&" "&B2, =A3&" "&B3 etc. But when I make the text appear using control+ I only get the concatenation of the first row repeated all the way down, irrespective of the contents of other cells in Column B.

View 14 Replies View Related

Continuously Concatenate 2 Columns

Jan 15, 2008

I have a series of data in 2 columns...say A and B...that I want to concatinate into a string of data...i.e A1&A2&B1&B2&C1&C2 etc etc....

Can I include this in a macro so that it will continue to concatinate the data until it gets to the end of the list (i.e a blank cell) ?

View 6 Replies View Related

Concatenate Words From 2 Columns

Feb 15, 2008

I need a simple macro to take a list of words in 1 column, and concatenate them with each word from another column

So if Column A had "bird"

and Column B had
food
feeder
house

the output would be

bird food
bird feeder
bird house

I will have many many more words than just "bird" though.

View 3 Replies View Related

Concatenate Multiple Columns With Spaces

Jun 21, 2008

I've searched quite a few times for Concatenating Multiple Columns and ones for Concatenating with Spaces.

I've found solutions that say use

=concatenate(A1, " ", B1)

or the VBA equivalent

I have at least 15-20 columns which I wish to concatenate.

Is there an easier way than to type for all 15 columns?

=concatenate(A1," ", B1," ", C1,....)

Also, the number of columns of each row vary

View 9 Replies View Related

Concatenate 2 Columns To Make Every Possible Combination

Jul 19, 2009

Is there an easy way to concatenate two columns and provide every possible combination?

E.g.,
A B
1 A1 B1
2 A2 B2
3 A3
The function should result in
C
1 A1B1
2 A1B2
3 A2B1
4 A2B2
5 A3B1
6 A3B2

View 3 Replies View Related

Concatenate Function To Merge Certain Columns

Aug 14, 2009

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 Related

Auto-Concatenate Columns-row Within Worksheets

Mar 21, 2007

How do I create a code that will concatenate the number in Column B, C and D into Column E for each row within each worksheet of the file, excluding the "Update" worksheet. If there is no number is each column of the row, then do not produce a record for that row in column E. Start executing function on row 2.

eg E2=b2&c2&d2=047, E3=b3&c3&d3=964, E4 cell is empty, because there is no record in b4, c4 and d4

View 9 Replies View Related

Concatenate Columns Into File Path

Nov 15, 2006

I am creating an excel file for a mail merge following this process. I need to take the three columns below and enter the path to the corresponding chart. I have all the charts created in a directory. The naming convention for all of the files is XX-XX-XX.gif. The X's represent the numbers below without the decimal places. Therefore the example below would be 44-43-27.gif. Is there anyway to create a formula to drag down instead of entering the filename's manually? In the end, I want to have the full file path as shown in the XLS.

q_3_abc q_3_teamq_3_yscore
4.4 4.3 2.7

I have 700+ rows to do this for, therefore I want a formula or VBA solution instead of the manual donkey work.

View 3 Replies View Related

Concatenate (Join) Cells Across Columns

Feb 9, 2008

I have a marco that works perfects to Concatenate (join) all of the cells in Column A. However, I want to seperately join all of the cells in each column. So I wanted to the Concatenate of Column B to go in B1, Column C to go in C1, etc (or until there is no data in a column). I think there is a way to change this into a loop, but I don't know how. Below is the macro I have now.

Sub ConcatenateAll()
Dim x As String, rng As Range, cel As Range
With ActiveSheet
Set rng = .Range("A2:A300")
For Each cel In rng
x = x & cel.Value
Next
.Range("A1").Value = x
End With

End Sub

View 2 Replies View Related

Vlookup And Concatenate Multiple Columns Of Date?

May 8, 2014

Say in L4 on form test i want to look for the value of A4 in Drill data range a2 to z1000 and retun a concatenated string of something like "sav 407 : 08-may to 11-may"

View 3 Replies View Related

Excel 2007 :: Consolidate Several Columns Into One (not Concatenate)

May 6, 2014

I have the following situation and I'm trying to do this using a PC with Excel 2007.

I would like this:
T
N
O
O
C
O
E
I
M
I
T

[Code] ........

To look like this:

T

H

A

N

K

[Code] .........

This procedure will become part of a macro. The number of rows will vary but the number of columns will be the same (11 columns). I don't care too much about the order since I can later sort. As long as the data from all columns in now in one column.

View 7 Replies View Related

Concatenate Multiple Columns But Ignoring Blank Values

Aug 13, 2012

I wish to Concatenate contents of several columns into a separate column, i tried using the following "column1 & column2 & column3 etc..." however with this the blank cells get concatenated too...What should is use so that contents get concatenated but blank cells are ignored?

View 4 Replies View Related

Concatenate Cells In Columns & Change Part Of Font

Apr 12, 2008

I need for it do perform the same action on multiple rows/ cells of data. What adjustment to the code needs to be performed to do so?

Sub fconcat()
Range("C1").Value = Range("A1").Value & Range("B1").Value
For i = 1 To Range("A1").Characters.Count
Range("C1").Characters(i, 1).Font.Name = Range("A1").Characters(i, 1).Font.Name
Next
For i = 1 To Range("B1").Characters.Count
Range("C1").Characters(Range("A1").Characters.Count + i, 1).Font.Name = Range("B1").Characters(i, 1).Font.Name
Next
End Sub

View 3 Replies View Related

Concatenate Column With Adjacent Column In Loop

Sep 27, 2007

I had a problem finding something then deleting the column, I tried to alter the code from that thread to solve a new problem and I am close (I think), but not quite there. I need to find the column "Group" and merge it with the column "Sex" which is offset by 1 column. This code will go through and find the column "Group" and merge for the first cell, but will then get stuck in a loop just concatenating "Sex" to the end continuously. I need it to concatenate both columns entirely together. Any simple fix to what I modified? Previous thread should you be interested:Find Part Text On All Sheets & Delete The Column.

View 9 Replies View Related

Information From 2 Columns

Mar 11, 2009

I am unsure if this was answered already but I am having a lot of trouble. I am trying to find out if it is possible to count the number of entries in one column if it meets criteria in another comlumn?

Here is my problem: I work for a contractor and I am trying to find out the number of contracts sold(column J) by Mike (Column K). I have tried =COUNTIFS functions but these dont work. I know if I create 4 other columns with IF functions I can get the information but I have to imagine there is another way.

View 9 Replies View Related

Macro To Concatenate Variable Amount Of Columns Based On Cell Value

Jul 23, 2014

I have a table that looks like:

7300
3

7301
2

7302
5

And I am trying to make a macro that will go concatenate the first 3 columns of all rows in worksheet 7300, the first two columns of all rows in worksheets 7301, etc, and insert them into column A of each corresponding worksheet.

View 7 Replies View Related

Merging Two Columns Of Information

Jul 16, 2009

I have two very long columns of client names. The columns represent reports that were run at different times on the same information.

What I want to do is merge the two clomuns. The issue is that there are many names that are the same but some that are different. Is there a way that you can merge the info. So it ignores the client names that are the same but auto adds the ones that are new. There are financials in other columns that I want to have come along during the merger.

View 7 Replies View Related

Search 2 Columns Of Information

Aug 2, 2007

I have the following code below, im not sure how to modify it to make it only search 2 columns of information, how can do this?

Private Sub CommandButton3_Click()
Dim StrFindWhat As Range
Dim NextCell As Range
Dim WhatToFind As Variant

WhatToFind = Application.InputBox("Please enter the Application or Service you want to search for?", "Search", , 500, 80, , , 2)
If WhatToFind "" And Not WhatToFind = False Then
For Each oSheet In ActiveWorkbook.Worksheets
oSheet.Activate
oSheet.[b4].Activate.....................

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved