View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
COM COM is offline
external usenet poster
 
Posts: 40
Default Locking cells in Excel

If you have a method that gets your VB running fine, and accomplishes the task you want, but still having problems with then setting up the queries in VB code, and having the results pasted into the sheet would fix that problem. Another option is to have code that will unprotect the necessary sheet(s) prior to the queries being run. Not sure how to disable queries by VB code, but if you can disable the query until you enable it to be run by the VB code, then that would also solve your problem. Maybe something like, disabling auto recalculate on the worksheet, with all the cells protected except A1, when A1 gets changed, it fires off VB code, that first unprotects the sheet, then forces a recalculation, and begins running the other VB code you have. Prior to "finishing" the VB code then re-protects the sheet(s). How's that sound?