PDA

View Full Version : macro to copy and past into mulitple worksheets



keilah
04-28-2008, 12:56 AM
See attached workbook (book1.xls)

Hi Experts

Need a macro to allow any user to select either a single customer or multiple customer(s) by clicking the add macro button.

Once that user has selected the customer(s) via a Userform (possibly holding down the CRTL Key) to allow for multiple selections.

They click ok to proceed to a second Userform which has a list of all the Supplier name(S) as shown in book1.xls Worksheet Customer.

At this stage

The User once again has the option of choosing which supplier(s) they which to add the customer(S) they selected at the starting point to which Supplier(s)?..

So for example if I selected GDF as my customer and I which to add this too supplier(s) India. UK and the USA??.

When I me add I mean copy and paste the name GDF into a particular range i.e. A20:A30 in all worksheet(s) in the Supplier Category?..

Thanks

Note: I have also posted this to experts exchange website.....and have not ahd any postive feedback

matthewspatrick
04-28-2008, 04:47 AM
Note: I have also posted this to experts exchange website.....and have not ahd any postive feedback

Please provide a link to your question at Experts Exchange...

keilah
04-28-2008, 04:48 AM
how would i do that????? provide the link......

keilah
04-28-2008, 04:49 AM
ok patrick try this

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_23357981.html

keilah
04-28-2008, 08:51 AM
not sure if i have aske dthe question in a incorrect manner that i am not getting any feedback????????

lucas
04-28-2008, 09:04 AM
Keilah, it is not an unreasonable request. Many people spend hours trying to solve your problem just to find out it has already been solved......how would you feel?

Please read this to help you understand the people who are going out of their way to help you for free......

http://www.excelguru.ca/node/7


And the answer to your question in post #5 is that if people find out (and they will) that you are cross posting and not providing a link then you are correct....many will pass your thread and not offer to help. It is up to you to learn how things work and try to make it as easy for everyone as possible.

keilah
04-28-2008, 11:04 PM
i apologied for that, it even harder when your new and keep on making mistakes.....so sorry once again..If i have messed up.

thanks for the feedback

Ken Puls
04-28-2008, 11:15 PM
It's not a big deal, Keilah. We just like to know, is all. The web forum world is very small, and many of us traverse multiple boards. So if you aren't getting any feedback, it can help draw other users in. All we ask is that links are provided (both ways) so that we can see if anyone has answered it before we spend our time on it.

I notice that the question on EE is now gone. Did you ever get an answer?

Ken Puls
04-28-2008, 11:22 PM
Also, just for reference, you're going to get much more willing help if you break this down into pieces. The board members here will help you build your solution, providing that you are willing to put in the effort to learn. If you just want it done for you, then we'll refer you to someone who charges on a project by project basis.

You know... John Walkenbach's Power Programming series has an excellent chapter on userforms that covers exactly what you're after. In the PP with VBA 2002 (http://www.j-walk.com/ss/books/bookxl19.htm) version it was Chapter 15.

keilah
04-28-2008, 11:22 PM
NO and thanks for the feedback.....Still waiting for some guru out there to provide a solution if that is the right wording to use.

I deleted the question and added it back because one of the guys on the board might help me. i will wait until noon my time then remove it.

keilah
04-28-2008, 11:24 PM
i am taking a course in VBA and intermediate excel......however, it harder when you have a disability to squeeze everything in.

once again thanks for the feedback......

keilah
04-28-2008, 11:50 PM
ok. guys. is there an aritcle i can read that allows me to do a copy and past into any selected worksheet using a userform?????

thanks

keilah
04-29-2008, 12:15 AM
hi KenPlus

re: John Walkenbach's Power Programming series has an excellent chapter on userforms that covers exactly what you're after. In the PP with VBA 2002 (http://www.j-walk.com/ss/books/bookxl19.htm) version it was Chapter 15.

can i read this chapter online......via a link???

matthewspatrick
04-29-2008, 04:05 AM
hi KenPlus

re: John Walkenbach's Power Programming series has an excellent chapter on userforms that covers exactly what you're after. In the PP with VBA 2002 (http://www.j-walk.com/ss/books/bookxl19.htm) version it was Chapter 15.

can i read this chapter online......via a link???

No, you'd have to buy the book. As it happens, I happen to think that it is an excellent book, and that any serious Excel developer should have a copy.

Ken Puls
04-29-2008, 07:19 PM
Back to your original question, I see that you either have the option of:

-Using a multipage control to tab through; or
-Building your userform so that you have a listbox on the left for your customer(s), as well as a listbox on the right for your country(ies)

What sounds better to you?

keilah
04-30-2008, 03:09 AM
Hi KenPuls

Firstly, thanks for your help/assistance could you kindly give me an example of what a multipage control to tab through looks like.

Apologies if this request sound bazzarrr

Ken Puls
04-30-2008, 09:32 AM
Hi keilah,

I've attached a VERY basic userform with a multipage control on it. (There is nothing in it yet.)

You can leave the tabs on, or turn them off and control the flow with buttons on the userform. The way I would work this with a multipage is to guide the user step by step through the process. So:
-Listbox on page 1
-Add a button (at the bottom of the uf) for Next/Back
-Listbox on page 2
-Once the end is reached, change the name on Cancel to Done

Something like that.

You can find code for returning selected listbox items in the KB. (Look for Listbox, and narrow down the search to Excel, and possibly my name.)

Cheers,