Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I select a block of contiguous cells in the same column, is it possible to
create a macro that will combine all the data, in the order of top selected cell to the bottom selected cell and place it in proper order into a single cell (the top cell of the selected block)--I don't want to merge the cells, I just want all the data from a block of selected cells to be placed into one cell. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you want to clear all of the other cells?
Sub test() Dim c As Range Dim s As String For Each c In Selection s = s & IIf(s = "", "", Chr(10)) & c.Value Next c Selection.Cells.Value = "" Selection.Cells(1).Value = s End Sub Tim. "Janna" wrote in message ... If I select a block of contiguous cells in the same column, is it possible to create a macro that will combine all the data, in the order of top selected cell to the bottom selected cell and place it in proper order into a single cell (the top cell of the selected block)--I don't want to merge the cells, I just want all the data from a block of selected cells to be placed into one cell. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should get u started
Sub combine() C = Empty Range("B4:b8").Select D = ActiveCell.Value Dim A As String A = Selection.Address Dim C As String Do Until ActiveCell = "" C = C & D D = ActiveCell.Offset(1, 0).Value ActiveCell.Offset(1, 0).Activate Loop Range(A).Select ActiveCell = C End Sub "Janna" wrote: If I select a block of contiguous cells in the same column, is it possible to create a macro that will combine all the data, in the order of top selected cell to the bottom selected cell and place it in proper order into a single cell (the top cell of the selected block)--I don't want to merge the cells, I just want all the data from a block of selected cells to be placed into one cell. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to combine number data from one column into another column | Excel Discussion (Misc queries) | |||
combine column data | Excel Discussion (Misc queries) | |||
how to combine data from Column A & B | Excel Discussion (Misc queries) | |||
How to combine data from two columns into one column? | Excel Worksheet Functions | |||
Macro to Combine 2 columns to make one column without merging | Excel Discussion (Misc queries) |