Click here to Skip to main content
15,922,533 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalplease help Pin
Rodney14-Jun-01 20:39
Rodney14-Jun-01 20:39 
Generalinput validation Pin
Ian11-Jun-01 2:37
Ian11-Jun-01 2:37 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 3:09
Michael P Butler11-Jun-01 3:09 
GeneralRe: input validation Pin
Ian11-Jun-01 4:16
Ian11-Jun-01 4:16 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 5:00
Michael P Butler11-Jun-01 5:00 
GeneralRe: input validation Pin
Ian11-Jun-01 5:36
Ian11-Jun-01 5:36 
GeneralRe: input validation Pin
Ian11-Jun-01 5:59
Ian11-Jun-01 5:59 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 8:48
Michael P Butler11-Jun-01 8:48 
I think the boolCanExit = True needs to be inside the Do loop

Private Sub Workbook_Open()


Dim boolCanExit As Boolean



Do
boolCanExit = True ' will always exit unless the user enters incorrect value


'gets the rent credit value from user
'and pastes it into the relevant cell
myref = Application.InputBox(Prompt:="Enter refund, redec or incentive", Default:="refund", Type:=2)


If myref = "refund" Then
ActiveSheet.Cells(18, 1).Value = "Refund"
ActiveSheet.Cells(32, 1).Value = "91/500 908999"
Else
If myref = "redec" Then
ActiveSheet.Cells(18, 1).Value = "redec"
ActiveSheet.Cells(32, 1).Value = "62/100 225/13"
Else
If myref = "incentive" Then
ActiveSheet.Cells(18, 1).Value = "incentive"
ActiveSheet.Cells(32, 1).Value = "62/100 425/08"
Else: MsgBox "Error you have not entered a relevant type for credit"
boolCanExit = False
End If

rentac = Application.InputBox(Prompt:="Enter rent account number", Default:="1234567", Type:=0)
tenant = Application.InputBox(Prompt:="Enter name of tenant", Default:="Tenant", Type:=2)
Address = Application.InputBox(Prompt:="Enter address of tenant, on one line please", Default:="Address", Type:=2)
payee = Application.InputBox(Prompt:="Enter name of cheque payee please", Default:="Cheque Payee", Type:=2)
payeeadd = Application.InputBox(Prompt:="Enter address of cheque payee, on one line please", Default:="Payee Address", Type:=2)
myNum = Application.InputBox(Prompt:="Enter amount of the credit", Default:=0, Type:=1)
debtorsac = Application.InputBox(Prompt:="Enter debtors account number from Maureen, or enter none", Default:="No Debtors Ac", Type:=1)
debtorsamount = Application.InputBox(Prompt:="Enter amount of the debtors account balance", Default:=0, Type:=1)


ActiveSheet.Cells(51, 2).Value = myNum
ActiveSheet.Cells(10, 1).Value = tenant
ActiveSheet.Cells(11, 1).Value = Address
ActiveSheet.Cells(86, 1).Value = payee
ActiveSheet.Cells(52, 1).Value = "Debtors" & debtorsac
ActiveSheet.Cells(52, 2).Value = "-" & debtorsamount
ActiveSheet.Cells(38, 1).Value = rentac
End If
End If
Loop Until boolCanExit = True
End Sub
GeneralRe: input validation Pin
Ian11-Jun-01 20:31
Ian11-Jun-01 20:31 
GeneralMicrosoft Outlook 2000 Pin
Mahesh Sundararaman10-Jun-01 23:49
Mahesh Sundararaman10-Jun-01 23:49 
Generalexcel vba Pin
Ian10-Jun-01 8:36
Ian10-Jun-01 8:36 
GeneralRe: excel vba Pin
Giles10-Jun-01 8:51
Giles10-Jun-01 8:51 
GeneralRe: excel vba Pin
Ian10-Jun-01 20:13
Ian10-Jun-01 20:13 
GeneralRe: excel vba Pin
Giles12-Jun-01 9:10
Giles12-Jun-01 9:10 
GeneralRe: excel vba Pin
Ian14-Jun-01 4:31
Ian14-Jun-01 4:31 
GeneralRe: excel vba Pin
Giles14-Jun-01 8:54
Giles14-Jun-01 8:54 
GeneralTextBox Question Pin
6-Jun-01 22:15
suss6-Jun-01 22:15 
GeneralRe: TextBox Question Pin
15-Jun-01 12:13
suss15-Jun-01 12:13 
GeneralRe: TextBox Question Pin
15-Jun-01 12:15
suss15-Jun-01 12:15 
GeneralTrying to detect Cancel in ShowPrinter Pin
jamesdturner@hotmail.com6-Jun-01 17:01
jamesdturner@hotmail.com6-Jun-01 17:01 
GeneralRe: Trying to detect Cancel in ShowPrinter Pin
AndyG6-Jun-01 17:26
AndyG6-Jun-01 17:26 
GeneralWriting selected cells from Excel in csv Pin
6-Jun-01 4:16
suss6-Jun-01 4:16 
GeneralPassing in variables to a VB executable Pin
31-May-01 12:46
suss31-May-01 12:46 
GeneralRe: Passing in variables to a VB executable Pin
AndyG3-Jun-01 22:04
AndyG3-Jun-01 22:04 
Question"Unrecognized format"? Pin
Jason Teagle31-May-01 8:15
Jason Teagle31-May-01 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.