Only me.
I have written myself a nice little sub to get interest rates from the user and insert these onto my sheet.
However I am having a problem !!
Before the input box appears I am checking for various things. One of these is that if the day is a weekend then copy the rate from the day before.
I have got this in my sub, but my question is this, if the date is a weekend and I copy the previous rate, how can I skip the inputbox bit of my sub and go back to the start of my loop ??
I have put my code below so I hope the above makes sense, I feel like I'm rambling a bit !
Show_Box = True
' Begin While loop.
While Show_Box = True
Sheets("INT RATES").Select
Range("a9999").End(xlUp).Select
oldval = ActiveCell
ActiveCell.Name = "fin"
If Range("fin").Offset(0, 1) <> "" Then
Range("fin").Offset(1, 0).Formula = oldval + 1
newval = Range("a999").End(xlUp).Formula
If WeekDay(newval) = 1 Or WeekDay(newval) = 7 Then
Range("b999").End(xlUp).copy
ActiveCell.Offset(1, 1).PasteSpecial Paste:=xlValues
End If
End If
valdat = Range("a5").End(xlDown)
' Show the input box.
Response = InputBox("Enter the interest rate for " & valdat, _
"Number Entry", , , 1000)
' See if Cancel was pressed.
If Response = "" Then
Range("a5").End(xlDown).Clear
' If Cancel was pressed,
' break out of the loop.
Show_Box = False
Else
' Test Entry to find out if it is numeric.
If IsNumeric(Response) = True Then
' Write the number(/100) to the selected cell
Range("b5").End(xlDown).Offset(1, 0).Value = Response / 100
'Show_Box = False
Else
' If the entry was wrong, show an error message.
MsgBox "Please Enter Numbers Only"
Range("a5").End(xlDown).Clear
End If
End If
' End the While loop.
Wend