Philip1957
Board Regular
- Joined
- Sep 30, 2014
- Messages
- 185
- Office Version
- 365
- Platform
- Windows
Greetings,
I have a macro to remove duplicate rows that I'm pretty sure used to run, but it isn't working now. I haven't used it in quite a while, but yesterday I needed it and it crashes with a run-time error 1004 at the "ActiveSheet" line.
Can anyone tell me what is wrong with it?
Thanks in advance for your time & assistance.
I have a macro to remove duplicate rows that I'm pretty sure used to run, but it isn't working now. I haven't used it in quite a while, but yesterday I needed it and it crashes with a run-time error 1004 at the "ActiveSheet" line.
Can anyone tell me what is wrong with it?
Code:
Sub Rmv_Dupe_Rows()
Application.ScreenUpdating = False
Dim clmn As String
Dim col As Long
' Prompt for column letter
clmn = Application.InputBox("Enter the letter designating" & vbCrLf & "the column where the duplicate" & vbCrLf & "data is located.")
' Convert to column number
col = Cells(1, clmn).Column
ActiveSheet.UsedRange.RemoveDuplicates Columns:=col, Header:=xlGuess
Application.ScreenUpdating = True
End Sub
Thanks in advance for your time & assistance.