inputbox arab name problem when father, not when mother or both

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
507
Office Version
  1. 365
Platform
  1. Windows
hello :)

i have a perfectly well working inputbox asking if you would like to see the parents / mother / father of the person in the activerow.
no problems with option 2 and 3 and no problem with choosing mother in option 1.
is an inputbox keeping some kind of memory that could make the choice to see only the father ('s row) a problem?
each row is a person: the name is in column B. mother's name in CP; father's name in CQ. if it is a name in non latin letters,
the transcription is in CS and CT.
the inputbox finds the column of the activerow for mother/father's name then search for that name (identical) in column B.
all is working well, except for choosing father's name when both are available.

thank you for your opinion and advice !!!
this is the code:


VBA Code:
Sub vindouders() ' ------------------------------------------------------------------------------------------------- [ F4 ]
Dim keuze As Variant
Dim zoekmam As Range
Dim zoekpap As Range
Dim zoekma As Variant
Dim zoekpa As Variant
Dim dezerij As Long
Dim aantalcontacten As Variant
aantalcontacten = Worksheets("gegevens").Cells.SpecialCells(xlCellTypeLastCell).Row - 4
dezerij = ActiveCell.Row
zoekma = "*" & Range("cp" & dezerij).Value & "*"
Set zoekmam = Range("rngpersoon").Find(zoekma, , xlValues, xlWhole)
zoekpa = "*" & Range("cq" & dezerij).Value & "*"
Set zoekpap = Range("rngpersoon").Find(zoekpa, , xlValues, xlWhole)
' ========================================================== geen ma geen pa
If zoekmam Is Nothing And zoekpap Is Nothing Then
MsgBox Range("m" & dezerij).Value & " " & UCase(Range("n" & dezerij).Value) & Chr(10) & _
"heeft geen ouders staan in deze lijst. "
Exit Sub
End If
' ========================================================== wel ma wel pa
If Range("cp" & dezerij).Value <> "" And Range("cq" & dezerij).Value <> "" Then
If Range("cs" & dezerij).Value <> "" Or Range("ct" & dezerij).Value <> "" Then
keuze = InputBox(Chr(10) & _
    "Deze lijst bevat " & aantalcontacten & " contacten." & Chr(10) & Chr(10) & _
    "De ouders bekijken van " & Chr(10) & Range("p" & dezerij).Value & " : " & Chr(10) & _
     "______________________________________________________" & Chr(10) & _
    "tik 0 om dit scherm te verlaten." & Chr(10) & _
    "tik 1 om naar " & Range("cs" & dezerij).Value & " te gaan" & Chr(10) & _
    "tik 2 om naar " & Range("ct" & dezerij).Value & " te gaan" & Chr(10) & _
    Chr(10), "OUDERS BEKIJKEN VAN " & Range("m" & dezerij).Value & " " & UCase(Range("n" & dezerij).Value), , 11000, 10000)
Else
keuze = InputBox(Chr(10) & _
    "Deze lijst bevat " & aantalcontacten & " contacten." & Chr(10) & Chr(10) & _
    "De ouders bekijken van " & Chr(10) & Range("m" & dezerij).Value & " " & UCase(Range("n" & dezerij).Value) & " : " & Chr(10) & _
     "______________________________________________________" & Chr(10) & _
    "tik 0 om dit scherm te verlaten." & Chr(10) & _
    "tik 1 om naar " & Range("cp" & dezerij).Value & " te gaan" & Chr(10) & _
    "tik 2 om naar " & Range("cq" & dezerij).Value & " te gaan" & Chr(10) & _
    Chr(10), "OUDERS BEKIJKEN VAN " & Range("m" & dezerij).Value & " " & UCase(Range("n" & dezerij).Value), , 11000, 10000)
End If
Select Case keuze
    Case 0
    GoTo einde
    Case 1
        Range(zoekmam.Address).Select
        Exit Sub
    Case 2
        Range(zoekpap.Address).Select ' ==================================================== hier zit altijd een fout ==================
        Exit Sub
End Select
End If
[...]
 
only conclusion, you didn't subcribe your problem good !
Your father was the problem in the inputbox, with a memory (impossible) and the solution was finding the mother with another value (if her name wasn't latin)
Can you debug your code (step by step in the VBA-editor), i guess you can't.
i cant. i even dont know what debug is (i'm not a native english speaker) (lol)
but thanks all for the help ...
as i said one problem remaining: see other post :) !
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top