Hi everyone!
I'm creating an InputBox that pulls from various cells in my worksheet to create a sentence as the default value in the text-space. For example:
A1 = Policy Number
B1 = Credit Amount (i.e. $10)
C1 = $ Info [i.e. if credit is for one month (1 x 10), if two months (2 x 10)]
D1 = Date Policy Ended
E1 = Months Excluded from Bills
Thus, the sentence that the InputBox would display would be:
Today's Date + A1 + B1 + C1 + D1 + E1
Date - Policy # - Credit Amount - Info - Date Ended - Months Excluded
A text example would be:
30JUL2009 - 1234 - $10 - 1x10 - 01JUN2009 - Exc Jul,Aug09
The issue I'm having is how to have the InputBox macro ignore one of the cells if it's empty. My current code is:
For these notes, I will not always have a credit amount, in which case the macro should ignore B1 and C1; the sentence would then be as follows:![]()
Private Sub ContactNotes_Click() Dim CNote CNote = InputBox("", "Contact Note", Format(Date, "ddmmmyyyy") & " - " & Range("A1") & " - " & Range("B1") & " - " & Range("C1") & " - " & Range("D1") & " - " & Range("E1")) End Sub
30JUL2009 - 1234 - 01JUN2009 - Exc Jul,Aug09
Any ideas
Cheers,
- I Love Lagar -
Bookmarks