Hello!

We use a fairly large amount of macros at my company, but I'm having a very strange issue after upgrading from Excel 2010 to Excel 2013. All of my macros have broken! For example, the following macro is used to "merge" two columns of data. This macro works in Excel 2010 but not in 2013.

Sub MergeandJoin()
'
' Macro1 Macro
'

'
    
Dim lastrow, multiplecount As Integer
Dim a1, a2, b1, b2, b3 As String

Application.ScreenUpdating = False

Range("A1").Select
Range("A1").Activate

lastrow = ActiveSheet.UsedRange.Rows.Count
multiplecount = 0

For i = 1 To lastrow
a1 = Cells(i, 1).Value
a2 = Cells(i + 1, 1).Value
    
    If a1 = a2 Then
    
        b1 = Cells(i, 2).Value
        b2 = Cells(i + 1, 2).Value
        b3 = b1 & Chr(10) & b2
        Cells(i + 1, 2).Select
        ActiveCell.Value = b3
        
        multiplecount = multiplecount + 1
    
    ElseIf a1 <> a2 And multiplecount <> 0 Then
        
        Rows(i - multiplecount & ":" & i - 1).Select
        Selection.Delete Shift:=xlUp
        i = i - multiplecount
        lastrow = lastrow - multiplecount
        multiplecount = 0

    End If

Next i

Range("A1").Select

Application.ScreenUpdating = True

End Sub
Any help would be greatly appreciated!