Hello All,
I have a macro that I need to clear data first from Spreadsheet and this means unmerge cells as well as later merge them. I used the following code for the:
Unmerging:
Dim lrowVis As Long
Application.ScreenUpdating = False
With Sheets("Visualisation")
lrowVis = .Cells(Rows.Count, "Z").End(xlUp).Row
.Range("Q2:Q" & lrowVis).Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Selection.UnMerge
and Merging:
Range("V2:V9").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 60
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
with a copy down:
Range("V2:V9").Select
Selection.Copy
Range("V10:V" & lastr).Select
Selection.Paste
ActiveSheet.Calculate
Application.CutCopyMode = False
My problems is when I run the Macro it comes back with the pop out advising me of losing data that is merged as only the top row cell info is going to be displayed.
how can I get rid of that message - the macro answering yes to itself and carrying on?
Appreciate suggestions.
Thank you in advance for trying out.
Simon
Bookmarks