Question : VBA querytables.refresh not working

I am using Microsoft Query to link an Excel Spreadsheet to an Access Database.  I have created a parameter query that gets its value from a cell on the spreadsheet.  I then created VBA to automatically update the query table.  But it's not working.  Either it does nothing or when try to include the datarange name, it gives me an error.  If I manually refresh the sheet after changing the value, it's fine.  It's weird.

Answer : VBA querytables.refresh not working

Your code will only trigger when you _select_ cell D2. Is that what you intended, or did you want the Change event?
Incidentally, one of the options in the parameters dialog is to have the table automatically refresh when the parameter value is changed, so you shouldn't need code.
Random Solutions  
 
programming4us programming4us