Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The following macro merges correctly entries which jhave more than one row
,,, but when only one entry per name is available then it merges along with it the next row also. can any1 pls tell me where i have to correct Dim e As Integer e = 1000 Dim i1 As Integer Dim st As Integer i1 = 3 st = 3 Dim name As String Dim sr As Integer Dim ps As Long name = Cells(i1, 2).value sr = Cells(i1, 1).value ps = Cells(i1, 3).value For i1 = 3 To e If (name < Range("B" & i1)) And (sr < Range("A" & i1)) And (ps < Range("C" & i1)) Then Range("B" & st & ":B" & i1 - 1).merge Range("A" & st & ":A" & i1 - 1).merge Range("C" & st & ":C" & i1 - 1).merge name = Cells(i1 + 1, 2).value sr = Cells(i1 + 1, 1).value ps = Cells(i1 + 1, 3).value st = i1 ElseIf (name = Range("B" & i1) And i1 < 3) Then Range("A" & i1) = "" Range("B" & i1) = "" Range("C" & i1) = "" End If Next i1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Merging rows- urgent help req | Excel Discussion (Misc queries) | |||
URGENT! Macro help on incremental numbering for printing | Excel Discussion (Misc queries) | |||
MACRO URGENT HELP | Excel Discussion (Misc queries) | |||
Urgent - Help VBA Macro | Excel Discussion (Misc queries) | |||
URGENT Mac/PC macro compatibility problem | Excel Discussion (Misc queries) |