G
Guest
I’d like to replace the inputbox by a dropdownlist (with some informative
companying text) in order to avoid spelling errors in the inputbox and
‘misbehave’ of the macro. What’s the best way to do it? The different choices
in the dropdownlist should not be imported from an external sourcefile, but
from the macro itself. The action caused by the choice made should be remain
a search. I do not find a satisfactory solution. Who can help me? Thank you.
Dim Name As String
Name= InputBox("Type the correct name.")
If Name = "" Then
MsgBox ("Type the correct name is obligatory. If not the macro will stop
and you’ll have to restart.")
ActiveWorkbook.Close
Sheets("Curstellingen").Select
ActiveSheet.Delete
Sheets("Datablad").Select
End
Exit Sub
End If
With Cells.Find(What:=Name, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
End With
ActiveCell.CurrentRegion.Select
Selection.Offset(0, 1).Resize(4, 1).Select
Selection.Copy
companying text) in order to avoid spelling errors in the inputbox and
‘misbehave’ of the macro. What’s the best way to do it? The different choices
in the dropdownlist should not be imported from an external sourcefile, but
from the macro itself. The action caused by the choice made should be remain
a search. I do not find a satisfactory solution. Who can help me? Thank you.
Dim Name As String
Name= InputBox("Type the correct name.")
If Name = "" Then
MsgBox ("Type the correct name is obligatory. If not the macro will stop
and you’ll have to restart.")
ActiveWorkbook.Close
Sheets("Curstellingen").Select
ActiveSheet.Delete
Sheets("Datablad").Select
End
Exit Sub
End If
With Cells.Find(What:=Name, After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
End With
ActiveCell.CurrentRegion.Select
Selection.Offset(0, 1).Resize(4, 1).Select
Selection.Copy