Ciao ragazzi... è un po che manco da qusto forum...
Ultimamente sto realizzando una specie di gestione magazzino con una tabella abbastanza semplice che tenga part number seriale una breve descrizione e altre 2 cavolate...
tutto ok... fino a quando mi hanno richiesto un controllo per evitare di inserire un seriale 2 o +volte...
in giro per internet ho trovato qusto codice Vb
il mio problema è che dovrei riadattarlo perchè questo codice mi fa il controllo su tutti il foglio mentre a me serve solo su una colonna precisa di un foglio in particolare...codice:Private Sub Worksheet_Change(ByVal Target As Range) Dim fnd As Boolean Static JustErased As Boolean On Error GoTo Go_Away If JustErased Then JustErased = False Exit Sub End If Set c = Cells.Find(What:=Target.Value, After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) Do If Not Target.Value = Empty Then If Not c Is Nothing And c.Address <> Target.Address Then If c.Column = Target.Column Then MsgBox "Valore già presente in questa colonna!", vbExclamation + vbOKOnly, "Attenzione!" JustErased = True fnd = True Target.ClearContents Target.Select End If End If Else Exit Sub End If If fnd Then Exit Do Set c = Cells.FindNext(c) Loop While Not c Is Nothing And c.Address <> Target.Address Go_Away: End Sub
Qualcuno può darmi una mano?
Vi ringrazio in anticipo!!



