PDA

View Full Version : auto fill button



niyrho
12-10-2008, 03:40 PM
On sheet 1 I have a work order form. On sheet 2 I have a customer list. I want a button on sheet 2 that will fill in customer info on sheet 1.

So you can select one (highlight customer name) and click a button and it will put the customers name under "customer name" on sheet 1. Then it goes over one column and puts the value of that cell (address) into the "address" feild on sheet 1, and so on.

My biggest problem doing this is getting the macro to remember the row its on during each funtion. I know I'll probably need to use DIM or INDEX, but I havent gotten good enough to figure those out from scratch.

lucas
12-10-2008, 04:15 PM
Attach a small sample of your file without real information.......this is fairly easy to do using a template such as your sheet1 work order form.

niyrho
12-10-2008, 04:19 PM
I don't know how to do that.

lucas
12-10-2008, 04:19 PM
Do you want to save the sheets or print them?

lucas
12-10-2008, 04:20 PM
You can attach your file by clicking on the "post reply" button at the lower left of the last post in the thread.

When the page loads, add your message and then scroll down and look for a button that says "manage attachments" add your file to the post there.

lucas
12-10-2008, 05:07 PM
I'm having trouble with my internet connection tonight or else vbaexpress is slow..

attached is an example for you to examine. Checked rows get printed to specific places in the template. You can make it print after you get it set up instead of preview......

the code for the checks is in the code for the data sheet.

The cells are populated from an array created from the rows.....one at a time. See comments in the code.

niyrho
12-12-2008, 05:50 AM
I don't want this macro to save or print. I want it to copy. I attached an example. I don't have any codes in it because I don't know where to start.

Sheet 1 would be an order form. Sheet 2 is a customer list. I want to be able to either:

Select a customer on sheet 2 and hit one button that will enter all their info on sheet 1. And I will still need to be able to enter the info manualy if they're not on the list.

Or, if possible, the prefered method would be to have it do the same thing automaticly. So if I, on sheet 1, type in a "J" under "Name" it will look on sheet 2 for the first name on the list that starts with a "J" and fill in all that info for me. If I continue typing and hit "a" next it will go to the next name on the list because it starts with "Ja", and so on. If I fill it all out myself because that customer wasn't on the list then I want it to add all that info to the list when I print or save or something.

I would much prefer the latter, but the first optoin will do. I just need to make this thing work and I need it to be as idiot proof as possible.

lucas
12-12-2008, 11:50 AM
I don't have any codes in it because I don't know where to start.


We don't give full solutions here. This is a learning forum. You didn't even comment on the file I posted other than to say that you didn't want to print but rather wanted to copy. Copy to what? Another sheet? Another workbook?

I have tried to sort through your requirements and provide a beginning solution that you might consider. You can ask for more help but you are going to have to do some of the work yourself.

All of the things you suggesed can be accomplished but the devil is in the details........

Take a look at the attached and maybe we can go from there.