Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi. I have two bits of code that are getting hung on the merged cells i have in rows 1, 2 and 3. I need to keep the merged cells so i need the following two bits of code to ignore these rows. Does anyone have any ideas please? (and thank you in advance).
' this first bit gets rid of any duplicate rows. Sub Getridof() Dim mc As Long Dim i As Long mc = 1 'column A Columns(mc).Sort Key1:=Cells(1, mc), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1 If Cells(i - 1, mc) = Cells(i, mc) Then Rows(i).Delete Next i End Sub ' this bit is meant to sort column C into order. Range("C3").Sort Key1:=Range("C3"), Order1:=xlAscending, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Any way to sort rows of data with merged cells???? | Excel Worksheet Functions | |||
How can I sort an Excel Doc containing merged & non-merged cells? | Excel Discussion (Misc queries) | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
How to sort with merged rows | New Users to Excel | |||
Sorting merged cellsHow do I sort merged cells not identically siz | Excel Worksheet Functions |