Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help
Using this macro, I get syntax error. Tryng to combine merged cells so
I can graph data. Sub UnMergeTest() Dim C As Range, CC As Range Dim MA As Range, RepeatVal As Variant For Each C In Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)) If C.MergeCells = True Then Set MA = C.MergeArea If RepeatVal = "" Then RepeatVal = C.Value MA.MergeCells = False For Each CC In MA CC.Value = RepeatVal Next End If RepeatVal = "" Next End Sub Thanks in advance for help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Help
Try
Sub UnMergeTest() Dim C As Range, CC As Range Dim MA As Range, RepeatVal As Variant For Each C In Range(ActiveCell, Cells(Rows.Count, _ ActiveCell.Column).End(xlUp)) If C.MergeCells = True Then Set MA = C.MergeArea If RepeatVal = "" Then RepeatVal = C.Value MA.MergeCells = False For Each CC In MA CC.Value = RepeatVal Next End If RepeatVal = "" Next End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "MDMeyers" wrote in message ups.com... Using this macro, I get syntax error. Tryng to combine merged cells so I can graph data. Sub UnMergeTest() Dim C As Range, CC As Range Dim MA As Range, RepeatVal As Variant For Each C In Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)) If C.MergeCells = True Then Set MA = C.MergeArea If RepeatVal = "" Then RepeatVal = C.Value MA.MergeCells = False For Each CC In MA CC.Value = RepeatVal Next End If RepeatVal = "" Next End Sub Thanks in advance for help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |