|re: "i guess i have to pay more attention to detail"|
True...which is why I'll mention something else:
"which results to completing the function as opposed to stopping everything."
The code I sent is not a function, it is a subroutine.
The main difference is that a VBA function returns a value, but a VBA subroutine does not.
VBA can be used to create User Defined Functions (UDF) to perform tasks and return values that the built in Excel functions can't. The function name is placed in a cell just like a built in function, but it runs the VBA code associated with it to return the value.
You can recognize a UDF because it starts with Function <name> instead of Sub <name>.
For example, Excel has no built in function to Sum a range based on if the cells in the range are bold or not. However, a UDF could be constructed to do just that:
Function SumBold(ByVal Target As Range)
For Each tCell In Target
If tCell.Font.Bold = True Then _
bldSum = bldSum + tCell
SumBold = bldSum
If you enter =SumBold(A1:A10) in a cell, it will sum only those cells in A1:A10 where the font is set to bold.
Some fine examples of UDF's can be found here:
Start with the top link to "Custom Functions Introduction"