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: Marion Hayes   on Sep 30

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

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: