Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hi John
thanks for sending a more detailed explanation of your problem. Max's solution looks good, although it doesn't delete your lines. Following VBA Code should do what you need: Sub CleanUp() Dim SH As Worksheet Dim Col As Integer Set SH = Worksheets("Sheet1") Col = 3 For i = SH.Cells(65536, Col).End(xlUp).Row To 2 Step -1 If SH.Cells(i, 1) = "" Then SH.Cells(i - 1, Col).Value = _ SH.Cells(i - 1, Col).Value & SH.Cells(i, Col).Value SH.Rows(i).Delete End If Next i End Sub You have to adjust SH and Col according to your sheet. I used column one for checking if the line needs to be deleted, hope that is ok, otherwise you need to change that as well. I hope you understand what it does, otherwise just ask. hth Carlo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to merge from excel to word. New names won't merge | Excel Worksheet Functions | |||
Merge option is not available. How to undo merge in this case? | Excel Discussion (Misc queries) | |||
mail merge excludes my headers and critical data in Word merge | Excel Discussion (Misc queries) | |||
Merge =( formula should retain fraction type numbers after merge. | Excel Worksheet Functions | |||
how do i get my mail merge to update the data source at each merge | Excel Discussion (Misc queries) |