Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a row of 1's and 0's. I would like to merge all the cells with 1's
that are grouped in a row and not merge the 0's. Example: 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 So that the cells with 1's in them merge and the cells with 0's in them do not merge. Is is possible? Thanks in advance Carrie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub MergeCells() RowCount = ActiveCell.Row ColCount = 1 Do While Cells(RowCount, ColCount) < "" If Cells(RowCount, ColCount) = 1 Then StartCol = ColCount Data = 1 Do While Cells(RowCount, ColCount) = 1 And _ Cells(RowCount, (ColCount + 1)) = 1 ColCount = ColCount + 1 Data = Data & " 1" Loop Range(Cells(RowCount, StartCol), _ Cells(RowCount, ColCount)). _ MergeCells = True Cells(RowCount, StartCol) = Data End If ColCount = ColCount + 1 Loop "Carrie" wrote: I have a row of 1's and 0's. I would like to merge all the cells with 1's that are grouped in a row and not merge the 0's. Example: 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 So that the cells with 1's in them merge and the cells with 0's in them do not merge. Is is possible? Thanks in advance Carrie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Merging Excel Cells | Excel Discussion (Misc queries) | |||
Mail Merging from Excel 2000 to Word 2003 | Excel Discussion (Misc queries) | |||
Merging Cells in Excel | Excel Discussion (Misc queries) | |||
Merging cells in Excel 2003 | Excel Discussion (Misc queries) | |||
merging cells excel 2003 | Excel Discussion (Misc queries) |