I am new to programming Excel and could use some help. I have read a few thing but not able to piece it together.
I have a worksheet that has a list of values, say in Column A. I want to query a SQL database to see if that value exists in the database and if it does highlight the row for each row. Ideally it would do this after entering the number and moving to the next row. I could really use the help as I am at a loss on where to go. Do I do this in VBA, macro, ...?
My sql statement in a macro looks like this.
This is as far as I have been able to get to and not sure where to go from here. From what I understand this part works fine in getting the information from the DB, just not sure how to highlight the rows that have a returned value.![]()
Please Login or Register to view this content.
Example:
If A had the following
1154
1155
1156
1157
The query returns a 1 for 1154 and 1157 and NULL for 1155 and 1156. How would I now go about highlighting 1154 and 1157? I figure I could have the results enter the 1 in the given row in column B and have a highlighting rule but not sure how to do that either.
I tried
but it just enters the results to Row 2 starting in column B.![]()
Please Login or Register to view this content.
Hope this all makes sense.
Bookmarks