View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Anil Gupte
 
Posts: n/a
Default Unmerge+copy Macro

I did some quick learning and came up with this:
**************
Sub Unmerge()
Dim Rng As Range
Dim cell As Range
Dim v As String
v = Selection.Value
Selection.MergeCells = False
On Error Resume Next
Set Rng = Selection
For Each cell In Rng
cell.Value = v
Next cell
' Selection.FillRight
' Selection.FillDown
End Sub

**************
Only problem of course is that
v = Selection.Value

is not valid. I tried

v = Selection.item(0).value

and several other variations, but those did not work. How do I get the
original value?


--
Anil Gupte
"Stefi" wrote in message
...
Select the merged cell, then run this macro:

Sub UnMergeCopy()
Selection.MergeCells = False
On Error Resume Next
Selection.FillRight
Selection.FillDown
End Sub

Regards,
Stefi


"Anil Gupte" ezt írta:

I am looking for a simple macro that will umerge a cell and copy the
value
in the original merged cell into all the cells created as a result of the
merge. Any suggestions?

Thanx,
--
Anil Gupte