Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
On Error GoTo einde
With Target
If .Column = 1 And .Value <> "" Then
Sheets.Add(after:=Sheets(Sheets.Count)).Name = Target
.Offset(, 9).Hyperlinks.Add Anchor:=.Offset(, 9), Address:="", SubAddress:="'" & .Value & "'!A1", TextToDisplay:=" " & .Value
End If
End With
Sheets("1").Range("1:5").Copy Sheets(Sheets.Count).Range("1:5")
With Sheets(Sheets.Count)
.Columns.AutoFit
.[C2] = Target.Offset(, 1).Value
End With
einde:
Application.ScreenUpdating = True
End Sub
Sub geef()
Range("A3:U250").Interior.ColorIndex = xlNone
Set foundcell = ActiveSheet.Range("B:B").Find(InputBox("Wat zoek je? ", "Geef de hele naam"))
If foundcell Is Nothing Then
MsgBox ("Artikel niet aanwezig")
Else
Cells(foundcell.Row, 1).Resize(, 21).Interior.ColorIndex = 36
End If
End Sub
Sub geef1()
Range("A3:U250").Interior.ColorIndex = xlNone
Set foundcell = ActiveSheet.Range("C:C").Find(InputBox("Wat zoek je? ", "Geef de hele naam"))
If foundcell Is Nothing Then
MsgBox ("Artikel niet aanwezig")
Else
Cells(foundcell.Row, 1).Resize(, 21).Interior.ColorIndex = 36
End If
End Sub