Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Howdee all.
Well, this is coming in from the Google Groups- microsoft.public.excel.programming server-- any way to directly access the newsgroups anymore? If so-- please explain how, or provide a link. Last year, I was talking with Dave Peterson about a macro to loop based on the borders. Below is the code he'd provided. I now finally have time to sit down and work through it. The original post is @ http://groups.google.com/group/micro...be577f968cbcf8 The code is: Dim Mycell, myRng As Range Dim topcell, botcell As Range Set myRng = Selection For Each Mycell In myRng.Columns(1).Cells If Mycell.Borders(xlEdgeTop).LineStyle = xlSolid Or Mycell.Borders(xlEdgeTop).LineStyle = xlDouble Then Set topcell = Mycell Else If Mycell.Borders(xlEdgeBottom).LineStyle = xlSolid Then If topcell Is Nothing Then MsgBox "Missing topcell for: " & Mycell.Address(0, 0) Else Set botcell = Mycell Application.DisplayAlerts = False ActiveSheet.Range(topcell, botcell).Merge Application.DisplayAlerts = True End If 'get ready for next pair Set topcell = Nothing Set botcell = Nothing End If End If Next Mycell In my working through this, it appears to stop before it accomplishes my goal. I.e., it finds the TopCell, and then exits the macro. I need it to start working through each cell to find the BotCell, and then perform the merge operation. What am I missing here? Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A toggling border macro | Excel Discussion (Misc queries) | |||
Macro for a Border | Excel Discussion (Misc queries) | |||
Macro to add border | Excel Programming | |||
Place a Bottom Border in a Table via a Macro | Excel Discussion (Misc queries) | |||
Changing the border of one cell s/n change the border of adjacent | Excel Discussion (Misc queries) |