Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combining cell entries to one cell with code
I have 8 cells in a range what I want to do is loop through these cells and
if they have a name in them put them in the same cell seperated with a comma and a space, such as if A1:A8 = my range then I want to see if any of these cells have a name in them and if so I would get A1 = John A2 = Bob A3 = Harry B1 = John, Bob, Harry and so on can this be done? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combining cell entries to one cell with code
Sub names()
Dim i As Integer Dim s As String With Range("a1") Do Until IsEmpty(.Offset(i, 0)) s = s & .Offset(i, 0).Value & "," i = i + 1 Loop End With s = Left(s, Len(s) - 1) Range("b1").Value = s End Sub "jnf40" wrote: I have 8 cells in a range what I want to do is loop through these cells and if they have a name in them put them in the same cell seperated with a comma and a space, such as if A1:A8 = my range then I want to see if any of these cells have a name in them and if so I would get A1 = John A2 = Bob A3 = Harry B1 = John, Bob, Harry and so on can this be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can cell entries be based on word entries in another cell ? | Excel Worksheet Functions | |||
How to line break in one cell via a formula to stack cell entries | Excel Worksheet Functions | |||
Combining cell entries to one cell | Excel Programming | |||
Combining multiple cell information into one cell | Excel Discussion (Misc queries) | |||
Way to have VB code to filter on entries that have cell with today's date? | Excel Programming |