Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

(80% Discount Ends Soon!)

Combine Text from Multiple Cells in Excel










Hi, I am doing some qualitative analysis of some text using excel. My data right now is in an html table, and when I try to copy the table it sometimes puts the text that was intially in one cell into multiple cells in Excel if there were breaks in the text within the cell of the table. So, if a cell contains 5 lines of text with line breaks between them <br>, when I bring it into excel it puts the content into 5 different cells (in the same column). Does anyone know if there is a way: 1. to prevent this from happening when I paste, or 2. to combine all 5 of the cells into one cell with multiple lines? Thanks for any help!


Hey all having a dummie moment on a formula here i need t oknow if i can have text added into 1 cell with having a formula with a answer in it as well,,,i have attached a sheet with better examples of what i mean,,,its easier to understand it by seeing it,,,,please help


Hi,

I have 3 columns, one is Text, one is Date and the last is Time. I managed to combine the Date and Time cells and have them formatted properly but I can't figure out how to add my Text. So I am here for help. Attached is my original spreadsheet. I would like have all three cells combined into one with maybe about 4 or 5 spaces between each value. Then I would like to use the Paste Special - Values to remove the formulas so I can delete the 3 columns and just have 1 column.

Thank you for your help.


Hi All,

I am trying to create a formula for the following scenario but to no avail. Please note that Cell in Col A Sheet1 have multiple values. e.g A1 contains "ID001, ID002, ID003"

Sheet 1:
Col A Col B
ID001, ID002, ID003 Yes
ID004, ID005, ID006 No

Sheet 2:
Col A Col B
ID002 [Return Value = Yes]
ID006 [Return Value = No]


Hello All,

I want to create a formular to return a value by searching a partial text. For example, in Sheet 2 col B, I want to search Sheet 2 col A (ID001) from the partial text of Sheet 1 Col A (ID001 - Name 1) and return the value of Sheet 1 Col B to Sheet 2 Col B (Yes).

Sheet 1:
Col A Col B
ID001 - Name 1 Yes
ID002 - Name 2 No
ID003 - Name 3 No

Sheet 2:
Col A Col B
ID001 [Return Value]
ID003 [Return Value]

Thanks for your help in advance.


Morning all,

Using Excel 2007.

Is it possible to combine a text value and a vlookup into a single cell ?

By way of example what I have at the moment is the text "Batch 1:" in cell A10 and a lookup in cell B10 which pulls through a comment on Batch1 from another source.

The problem is that cells A1 to A8 contain further text in each cell. Now this text is a lot longer than Batch 1 but it still needs to be seen.

So what I have is :

Batch 1: Then the result of my look up further over the sheet than I would like (it amounts to about 30 spaces away).


So, I was wondering if it is possible to combine the text Batch 1: and the vlookup into the same cell?

All help appreciated.

TIA

D


Is there a way excel would be able to combine multiple text files, (comma delimited), into one spreadsheet when a macro is initiated?

For example I have 4-7 text files that we manually open and copy and paste into one excel document. Is there a way this can be automated?

Thanks.


I am using Access VBA to create a "MainFrame"-type file. For those of you who are unfamiliar with "MainFrame" type files, here are the important details:

1. There are three sections, Header (one row at top), Details, and Trailer (one row at bottom)
2. The records are Fixed Width
3. All records must be the same length

The issue is that the record length is often quite long (1500 in my current project), and the format of the Header, Details, and Trailer records are not remotely the same.

So what I have done is I have created three queries, one for each section, and then exported each to a text file, i.e.
tmpHeader
tmpDetails
tmpTrailer

Now, what I would like to do is "combine" these three text files together to make my one, single, complete MainFrame file.

I can do this pretty easy if I create in a one line DOS Batch file (using the COPY command). I also know I could create recordsets in VBA and loop through each, and write out each field, but with the size of each record, that doesn't seem to be the most efficient way to go.

So I am looking for a simple way to do this in Access VBA that is similiar to how I would do it in a DOS batch file, but I can quite figure out how the syntax for. I have been Googling the web, but still haven't found what I am looking for yet.

Does anyone know how to do this?


Wondering if someone could help with the following problem. I have a large list of text in one column which i need to combine between blank rows into one cell or a new column, the number of rows to be combined varies. for example

aa
bb

ww
xx
zz

rr

gg
hh
ii
jj


would become

aa bb
ww xx zz
rr
gg hh ii jj

I have over 30000 lines so doing it by hand is not an option.
Thanks for any help or suggestions.


Hello all
I have the following task that I'm hoping code will automate for me.

1. I select cells over several rows in a column, each of which has text in it.
2. I need the top cell to have the text from each of the other cells added to it, with a semi-colon after each of those entries.

So, now I have just one cell, the top one, with all of those entries in it.

Thanks in advance.