PDA

View Full Version : error code, run time error '424



amrane
01-25-2012, 04:57 AM
Dear Forum,

Using macro record the I tryed to use "RemoveDuplicates Columns:=1, Header:=xlNo" but its not working, PLease let know the mistake inside.:doh:


Thank you in advance,

amrane

farrukh
01-25-2012, 06:13 AM
Hi amrane

instead of
iutput_item.RemoveDuplicates Columns:=1, Header:=xlNo

To

input_item.RemoveDuplicates Columns:=1, Header:=xlNo


Cheers

Farrukh

amrane
01-25-2012, 07:12 AM
Dear Farrukh

Thank you so much

amrane

Paul_Hossler
01-25-2012, 07:17 AM
Also 2 suggestions

Option Explicit would have caught the typo
VBA assumes variables are Variants unless each on has ' As .... something'


Option Explicit '<================================ add
Sub Sans_rep_Click()
'Dim input_item, Output_item As Range '<=== input_item is assumed to be variant type since there is no ' as ....'
Dim input_item As Range, Output_item As Range '<================== input_item is now typed as range
'inbox pour seltectionner le champes des cellules en entree de traitement
' par example selectionner "B$3$:B$16$
Set input_item = Application.InputBox(prompt:= _
"Enter the site list to be filtred (i.e $A$2:$B400$):", Title:="Source location", Type:=8)



' de enrigistrement des macros:
input_item.RemoveDuplicates Columns:=1, Header:=xlNo

End Sub


Paul

farrukh
01-26-2012, 11:25 PM
Hi Amrane,

If you satisfied for the answer please marked this thread as a solved.

Thanks you

Farrukh