concatenate error messages
Posted on 2011-04-21
Within a MACRO, if I'm using seperate IF statements to check the contents of cells for various conditions and writing an error message to a cell for each condition not met, how would I write multiple messages to the same cell if multiple conditions are not met? I'm not looking for the code to test the conditions, just how to write multiple error messages to the same cell (concatenate them)
For example (in plain English), let's say I'm testing a cell in column A as follows and I want to write any error messages to column D
If length of number in column A <> 4 then
column D = "Invalid length"
If data in column A is not numeric then
column D = "data is not numeric"
If date in column A > 1000 then
column D = "data is greater than 1000"
Now let's say the first two conditions are not met, I want column D to look something like this:
Invalid length, data is not numeric
All I'm trying to do is be able to write multiple error messages to the same cell (when seperate IF statements are used to test each condition)