In your line:
If c Is Nothing Then Exit Sub
You are exiting the sub routine without handling the blank variable for the input box. Write and "If" statement that tests the contents of the variable "c" and handle the test accordingly.
I don't like to use the following line unless I absolutely have to when writing VBA code:
On Error Resume Next
When you use this line then you are saying that if I get an error still run the next line of code and forget about the error. This is not good in most situations. Instead, write an error handler routine to handle the error.
Please note: Good VBA programming practices can be found all over the internet especially on MSDN (I know, hard to believe).
You will not find a lot of VBA stuff here at CP because this site "mainly" deals with C++, C#, and VB.Net coding. However, myself, Dalek Dave, and others have extensive VBA backgrounds and would be more than glad to help.
Dalek Dave, is a good Excel VBA guru and our resident accountant.
His profile is here[
^]
If you have any more questions then don't hesitate to ask.
-- Good luck.