Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
|
|||
|
|||
![]()
I have a relatively large spreadsheet with numerous values repeated
(within the same column) and I would like to merge adjacent, identical cells. I have attempted to tweak an existing macro that deletes repetitive, adjacent cells without any sucess. Does anyone have any suggestions? --Chris My existing macro for deleting these cells: Sub RemoveDuplicates() totalrows = ActiveSheet.UsedRange.Rows.Count For Row = totalrows To 2 Step -1 If Cells(Row, 2).Value = Cells(Row - 1, 2).Value Then Rows(Row).Delete End If Next Row End Sub |
#2
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
|
|||
|
|||
![]()
Instead of merging them, why not use a conditional format which "hides" the
duplicates with a white font. http://www.ozgrid.com/Excel/Formulas.htm#CONDFORM " wrote: I have a relatively large spreadsheet with numerous values repeated (within the same column) and I would like to merge adjacent, identical cells. I have attempted to tweak an existing macro that deletes repetitive, adjacent cells without any sucess. Does anyone have any suggestions? --Chris My existing macro for deleting these cells: Sub RemoveDuplicates() totalrows = ActiveSheet.UsedRange.Rows.Count For Row = totalrows To 2 Step -1 If Cells(Row, 2).Value = Cells(Row - 1, 2).Value Then Rows(Row).Delete End If Next Row End Sub |
#3
![]()
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
|
|||
|
|||
![]()
wrote...
I have a relatively large spreadsheet with numerous values repeated (within the same column) and I would like to merge adjacent, identical cells. .... You will almost certainly regret merging cells in Excel. Merged cells cause many problems, and a number of menu commands, such as sorting, won't work on ranges that contained merged cells. Also, if B5, C5 and D5 originally contained "foobar", and you merged B5:D5, you'd DELETE the contents of C5 and D5. Only B5 would contain "foobar". If you had formulas that referred to C5 or D5, they might no longer return correct results. What do you really want to accomplish? It's a near certainty merging cells won't do it unless you're only concerned with the appearance of your spreadsheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding repeated data in adjacent cells | Excel Discussion (Misc queries) | |||
Printing text in a repeated cell/row that is longer than repeated | Excel Discussion (Misc queries) | |||
Macro to Combine 2 columns to make one column without merging | Excel Discussion (Misc queries) | |||
Repeated Columns Don't look same on all pages... | New Users to Excel | |||
repeated transpose from rows to columns with unequal groups | Excel Discussion (Misc queries) |