Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: ij12 pe Simpatie.ro
 | Femeie 19 ani Prahova cauta Barbat 26 - 54 ani |
|
TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 806
|
|
Source:
This is a VBA solution. This macro will search every cell in the active sheet to see if they are merged. If they are, it stores the range of the merged cells in a temp. range variable, unmerges the cells, then fills the range with the value of the first cell in the unmerged range (what the value was).
Sub UnMergeFill()
Dim cell As Range, joinedCells As Range
For Each cell In ThisWorkbook.ActiveSheet.UsedRange If cell.MergeCells Then Set joinedCells = cell.MergeArea cell.MergeCells = False joinedCells.Value = cell.Value End If Next
End Sub |
|
|
pus acum 5 ani |
|
TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 806
|
|
Modified it so it suits my needs, unmerges and fills Selection instead of the entire sheet.
Sub UnMergeFillSelection()
Dim cell As Range, joinedCells As Range
For Each cell In Selection If cell.MergeCells Then Set joinedCells = cell.MergeArea cell.MergeCells = False joinedCells.Value = cell.Value End If Next
End Sub |
|
|
pus acum 5 ani |
|