I tried to setfocus in following code but was not sucessful.What is
wrong in the code?Can we use setfocus in VBA or is there any other
fuction.The code is as under
Dim strresponse, ans As String
rt:
If Range("Q1").Value <> "D" Then
Do
strresponse = InputBox("Enter the code of the Division.", "CBRO
Accts")
ThisWorkbook.sea = strresponse
If strresponse = "" Then
MsgBox "Code is compulsory", vbOKOnly, "CBRO Accts"
MsgBox "Do you want to continue", vbyesno, "CBRO Accts"
if ans = vbyes then
setresponse.setfocus
else if ans = vbno then
ActiveWorkbook.Close SaveChanges:=False
End If
Endif
Loop Until (strresponse <> "")
GoTo rt
End If