B
Brian Beck
I have a form that users fill in and there are 3 fields in which they fill
out their county, district and campus numbers (CDC #) to define their
location. Every user will put in this information, and it is what I use to
identify them later when I import all the data into an Access database.
Occasionally though, a user will either enter the wrong CDC # or they will
enter the correct one, but then when they write out the name of their
district and school, it will be something different from the one identified
by the CDC # they entered.
Now I know this is stuff I could easily check for at the time of entry, but
management is what it is and as such, I cannot include ANY macros in the
Word form. That being the case, I'd like to write a macro for me personally
so that when I am looking at a form, I could run this macro wherein it would
grab the county-district number, look that number up in an Excel file and
return the district name associated with that number. Additionally, it
would also take the full CDC # and query another Excel file that contained
all the campuses and return the campus name associated with that number.
This way, I could visually compare what the user typed in for their district
and campus names with what the CDC # they typed in corresponds to.
Naturally we want these to be the same, but on occasion someone mistypes the
CDC # and I'd like to catch that error as early as I can.
So how can I construct a Word macro that will allow me to do a VLOOKUP in an
Excel spreadsheet and return the value in a msgbox?
-Brian
out their county, district and campus numbers (CDC #) to define their
location. Every user will put in this information, and it is what I use to
identify them later when I import all the data into an Access database.
Occasionally though, a user will either enter the wrong CDC # or they will
enter the correct one, but then when they write out the name of their
district and school, it will be something different from the one identified
by the CDC # they entered.
Now I know this is stuff I could easily check for at the time of entry, but
management is what it is and as such, I cannot include ANY macros in the
Word form. That being the case, I'd like to write a macro for me personally
so that when I am looking at a form, I could run this macro wherein it would
grab the county-district number, look that number up in an Excel file and
return the district name associated with that number. Additionally, it
would also take the full CDC # and query another Excel file that contained
all the campuses and return the campus name associated with that number.
This way, I could visually compare what the user typed in for their district
and campus names with what the CDC # they typed in corresponds to.
Naturally we want these to be the same, but on occasion someone mistypes the
CDC # and I'd like to catch that error as early as I can.
So how can I construct a Word macro that will allow me to do a VLOOKUP in an
Excel spreadsheet and return the value in a msgbox?
-Brian