T
Terry
I have a spreadsheet that I introduced a macro to eliminate duplications
with ranking formulae in the sheet.
All works ok until after I input data to the sheet, then run (update
button) the macro.
The macro does the job it was intended for but now the "undo" function in my
Excel sheet is disabled.
Without the macro the "undo" function works OK.
Has anyone had similar problems and curred them without removing the macro.
Dim myArray(500, 2) As String
Dim myIndex As Long
Sub getNames()
Dim myArray(500, 2) As String
Dim myIndex As Long
Dim myRow As Long
Dim lastRow As Long
lastRow = Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
myRow = 1
myIndex = 1
For i = 4 To lastRow
myArray(myIndex, 1) = Sheets(1).Cells(i, 1)
myArray(myIndex, 2) = Sheets(1).Cells(i, 16)
myIndex = myIndex + 1
Next
'MsgBox myArray(myIndex, 1).Rank
myRow = myIndex - 1
myIndex = 1
For i = 4 To 13
For j = 1 To myRow
If CStr(myArray(j, 2)) = CStr(Sheets(2).Cells(i, 4)) Then
Sheets(2).Cells(i, 3) = myArray(j, 1)
myArray(j, 1) = ""
myArray(j, 2) = ""
Exit For
End If
myIndex = myIndex + 1
Next
myIndex = 1
Next
End Sub
TIA
Terry
with ranking formulae in the sheet.
All works ok until after I input data to the sheet, then run (update
button) the macro.
The macro does the job it was intended for but now the "undo" function in my
Excel sheet is disabled.
Without the macro the "undo" function works OK.
Has anyone had similar problems and curred them without removing the macro.
Dim myArray(500, 2) As String
Dim myIndex As Long
Sub getNames()
Dim myArray(500, 2) As String
Dim myIndex As Long
Dim myRow As Long
Dim lastRow As Long
lastRow = Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
myRow = 1
myIndex = 1
For i = 4 To lastRow
myArray(myIndex, 1) = Sheets(1).Cells(i, 1)
myArray(myIndex, 2) = Sheets(1).Cells(i, 16)
myIndex = myIndex + 1
Next
'MsgBox myArray(myIndex, 1).Rank
myRow = myIndex - 1
myIndex = 1
For i = 4 To 13
For j = 1 To myRow
If CStr(myArray(j, 2)) = CStr(Sheets(2).Cells(i, 4)) Then
Sheets(2).Cells(i, 3) = myArray(j, 1)
myArray(j, 1) = ""
myArray(j, 2) = ""
Exit For
End If
myIndex = myIndex + 1
Next
myIndex = 1
Next
End Sub
TIA
Terry