Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Nicole Hughes   on Sep 30 In MS Office Category.

  
Question Answered By: Shawna Welch   on Sep 30

You can't set the focus on a string, which is what is returned by InputBox. Try
this version:

Dim strresponse As String, ans As Integer
If Range("Q1").Value <> "D" Then
Do
strresponse = InputBox("Enter the code of the Division.", "CBRO Accts ")
If Len(strresponse) = 0 Then
ans = MsgBox("Code is compulsory. Do you want to continue?", vbYesNo, "CBRO
Accts")
If ans = vbNo Then
ActiveWorkbook.Close SaveChanges:=False
End If
End If
Loop Until (strresponse <> "")
' ThisWorkbook.sea = strresponse
End If

I couldn't figure out what the line "ThisWorkbook.sea = strresponse" was, but
it looks like maybe you are storing the user's response somewhere.

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VBA Queries Or get search suggestion and latest updates.


Tagged: