Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
[COLOR="Red"] For Each cl In Range("c19:c200").Cells.SpecialCells(2)
cl.Value = UCase(Left(cl.Value, 1)) & LCase(Mid(cl.Value, 2))
Next[/COLOR]
'============================
'Artikelgegevens
'============================
If Target.Column = 2 Then
Target.Offset(, 1).Value = ""
Target.Offset(, 1).Value = Workbooks("PPP artikelbestand.xls").Sheets("Opslag").Columns(1).Find(Target.Value, , xlValues, xlWhole).Offset(, 21).Value
End If
If Target.Column = 2 Then
Target.Offset(, 16).Value = ""
Target.Offset(, 16).Value = Workbooks("PPP artikelbestand.xls").Sheets("Opslag").Columns(1).Find(Target.Value, , xlValues, xlWhole).Offset(, 27).Value
End If
'=============================
'adres gegevens
'=============================
Dim wsFrom As Variant
Set wsFrom = Workbooks("PPP afnemer1 bewerkt.xls").Sheets("Opslag").Range("A2:BL3000")
If Target.Address = [E6].Address Then
Call vinden
Application.EnableEvents = False
Range("E7").Value = Application.VLookup(Target.Value, wsFrom, 3, 0)
If Range("E7") = "" Then Range("E7") = "Geen naam gevonden!"
Range("E8").Value = Application.VLookup(Target.Value, wsFrom, 5, 0)
If Range("E8") = "" Then Range("E8") = ""
Range("E9").Value = Application.VLookup(Target.Value, wsFrom, 6, 0)
If Range("E9") = "" Then Range("E9") = ""
Range("F9").Value = Application.VLookup(Target.Value, wsFrom, 7, 0)
If Range("F9") = "" Then Range("F9") = ""
Range("E10").Value = Application.VLookup(Target.Value, wsFrom, 10, 0)
If Range("E10") = "" Then Range("E10") = ""
End If
Application.EnableEvents = True
'==============================
' afleveringen
'==============================
Set wsFrom = Sheets("Afleveradressen").Range("L2:T50")
If Target.Address = [O6].Address Then
Application.EnableEvents = False
Range("Q7").Value = Application.VLookup(Target.Value, wsFrom, 2, 0)
If Range("Q7") = "" Then Range("Q7") = "Geen naam gevonden!"
Range("Q8").Value = Application.VLookup(Target.Value, wsFrom, 4, 0)
Range("Q9").Value = Application.VLookup(Target.Value, wsFrom, 5, 0) & " " & Application.VLookup(Target.Value, wsFrom, 6, 0)
Range("Q10").Value = Application.VLookup(Target.Value, wsFrom, 9, 0)
End If
Application.EnableEvents = True
'============================
'opmaak
'============================
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
Range(Cells(Target.Row, "C"), Cells(Target.Row, "P")).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
Range(Cells(Target.Row, "B"), Cells(Target.Row, "B")).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
Range(Cells(Target.Row, "Q"), Cells(Target.Row, "R")).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlHairline
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
Range(Cells(Target.Row, "A"), Cells(Target.Row, "A")).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
Range(Cells(Target.Row, "S"), Cells(Target.Row, "S")).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous 'xlDouble
.Weight = xlThin 'xlThick
.ColorIndex = xlAutomatic
End With
Target.Select
Application.ScreenUpdating = True
End Sub