UserForm Problem

K

Krayten

Hi Folks,

Hoping that some kind soul could give me a push in the right direction
here, please.

I wrote an excel vba application which presents the user with a large
UserForm with numerous pages and tabs, lots of inputboxes and the like.
The purpose of which is to contain in a pleasant-to-look-at and easy to
update format specific information about a site. Things like serial
numbers, registration codes, how many of each type of license is used
etc.....

The UserForm data is loaded from prepopulated cells in Sheet1 A100:A200
then when the data is updated the corresponding value in the "holding"
cell is updated. When the UserForm initialises the textbox reads
whatever is in that cell and takes that as it's value. Making updates
simple.

Problem:-
I now need to bring another few sites online and use exactly the same
UserForm to contain data about those site too.

I want to use a listbox to present a list of all the sites _but then
get the UserForm to initialise using the data from different "holding"
cells, depending on which site was picked to work with_

I then need the UserForm to write updated textbox values into the write
cells again depending on which site was picked to work with.

Can anyone think of a simple way to do this?

I don't want to have to build a seperate UserForm for each site ( with
it's own textboxes and tabs etc ) as that would take forever!

Would be grateful for any assistance. Especially if it could be
described with my very limited xl vba knowledge in mind.

Many Thanks,

Krayten
 
S

stevebriz

I think one way would be to create an array.

Load the array with the data relative to the site and reference the
Textboxes etc to the array.
When finished editing etc...write the array to the appropriate
spreadsheet.
If this is not too clear to you please let us know .HTH
 
B

Bob Phillips

Have an initial form, or even a tab on your form, with the listbox, and
select from there.

You can use a case statement to determine where the data is depending upon
the selection, or better still, name all the data according to the source.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top