View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pete Pete is offline
external usenet poster
 
Posts: 193
Default VBA Userform Textbox re-writing cells in Excel

I'm new to using VBA with Excel--I have Office 2003. I'm building a form in
VBA that will have random multiple-choice questions inserted into it from a
VLookup function's results in the accompanying spreadsheet. There is a big
table with the questions in column C and the 4 answer choices in columns d to
g, and the vlookups are on the top in cells C3 to G3.

I tried naming the cells that have the Q&A VLookup formulas as named ranges
in the spreadsheet, and then referencing the ranges in to Control Source of
the Properties box for each Q&A caption on the form. It works once but then
values get written in place of the VLookup formulas. Same thing happened
when I inserted the cell's names in ControlSource Property boxes--the cells
in the spreadsheet get the vlookup clobbered by the value of the first
result....and the vlookup formulae ares no longer there.

I tried changing ENABLED from true to false in the Properties box, and also
changed LOCKED from False to True...still I get the same problem.

I know I may be doing this in a not-very-elegant way--it does not need to be
a "hardened" program, just a prototype for a concept.

Thanks!