I am displaying data from a SQL query in Excel as follows:
ActiveCell.Offset(r, 1).Value = rs2.Fields(“OTCSalesQTD”).Value
When the returned value is NULL I would like to display ‘–‘ rather than an empty cell. How can this be done in Excel VBA?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
use a combination of IIF and IsNull, something like the below