Hey guys,

I'm really new to VB and also to the this forum. So please excuse my ignorance. I tried searching for this but I couldn't find anything that would do what I was looking for. Anyways.

I have 9 modules. Named OnePay through NinePay. On my spreadsheet I have a button. In the button I have the following code.

Private Sub CommandButton3_Click()

numberofpayments = InputBox("Enter the number of payments")

If numberofpayments = ("1") Then Call OnePay
If numberofpayments = ("2") Then Call twopay
If numberofpayments = ("3") Then Call threepay
If numberofpayments = ("4") Then Call FourPay
If numberofpayments = ("5") Then Call FivePay
If numberofpayments = ("6") Then Call SixPay

End Sub
This doesn't work. I get "expected variable or proceedure, not module" error.

What I would like to do is click the button, then have it ask me how many payments I want to create and call the module from there. Any help would be appreciated.