ritzkalz49
New Member
- Joined
- Aug 5, 2010
- Messages
- 3
Hi, I am new to this forum and seeking help.
I am using this code to unmerge the data and copying in each cell, but it is only working in column A. I need to the same in column B & C, it doesn't work even I change the range in the code. Please help
Sub unmergeA()
Range("A1:A" & Cells(Rows.Count, "D").End(xlUp).Row).MergeCells = False
For x = 2 To Cells(Rows.Count, "D").End(xlUp).Row + 0
If Cells(x, 1) = "" Then Cells(x, 1) = Cells(x - 1, 1)
Next x
End Sub
For column B I had tried this code
Sub unmergeB()
Range("B1:B" & Cells(Rows.Count, "D").End(xlUp).Row).MergeCells = False
For x = 2 To Cells(Rows.Count, "D").End(xlUp).Row + 0
If Cells(x, 1) = "" Then Cells(x, 1) = Cells(x - 1, 1)
Next x
End Sub
I am using this code to unmerge the data and copying in each cell, but it is only working in column A. I need to the same in column B & C, it doesn't work even I change the range in the code. Please help
Sub unmergeA()
Range("A1:A" & Cells(Rows.Count, "D").End(xlUp).Row).MergeCells = False
For x = 2 To Cells(Rows.Count, "D").End(xlUp).Row + 0
If Cells(x, 1) = "" Then Cells(x, 1) = Cells(x - 1, 1)
Next x
End Sub
For column B I had tried this code
Sub unmergeB()
Range("B1:B" & Cells(Rows.Count, "D").End(xlUp).Row).MergeCells = False
For x = 2 To Cells(Rows.Count, "D").End(xlUp).Row + 0
If Cells(x, 1) = "" Then Cells(x, 1) = Cells(x - 1, 1)
Next x
End Sub