Good morning all. My code below is bugging on Range(cell, cell.Offset(1, 0)).Merge on the very last row of my worksheet, and my belief is because the currency value in the "N" column that I'm merging on the last two cells is $0.00 with the very next cell being blank. I have other cells with $0.00 values that merge correctly but not these two cells. Doesn't bug if I temporarily change the cells value to $1.00.
Wondering what I might change to avoid this. (Have I said I friggin' hate merging.)
Thanks.
Dave
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim nextrow2 As Currency
nextrow2 = Range("N" & Rows.Count).End(xlUp).Row
Set nextRange2 = Range("N1:N" & nextrow2)
Check2:
For Each cell In nextRange2
If cell.Value = cell.Offset(1, 0).Value And cell.Value <> "" Then
Range(cell, cell.Offset(1, 0)).Merge
cell.VerticalAlignment = xlTop
GoTo Check2:
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Wondering what I might change to avoid this. (Have I said I friggin' hate merging.)
Thanks.
Dave
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim nextrow2 As Currency
nextrow2 = Range("N" & Rows.Count).End(xlUp).Row
Set nextRange2 = Range("N1:N" & nextrow2)
Check2:
For Each cell In nextRange2
If cell.Value = cell.Offset(1, 0).Value And cell.Value <> "" Then
Range(cell, cell.Offset(1, 0)).Merge
cell.VerticalAlignment = xlTop
GoTo Check2:
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True