We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

concatenate error messages

dbfromnewjersey
on
Medium Priority
219 Views
Last Modified: 2012-05-11
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"
end if

If data in column A  is not numeric then
   column D = "data is not numeric"
end if

If date in column A > 1000 then
   column D = "data is greater than 1000"
end if

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)
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
HainKurtSr. System Analyst
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.