Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy macro for a list box
I am new to VBA and am trying to work with a Userform
On my user form I have listed all contract #'s and they are not in any particular order. When I click on my userform I want to copy all the tests for the contract I highlighted to another sheet (sheet 1). How is this done? ie: contract # 123 456 789 456 123 I want every test for contract # 456 copied to sheet 1 starting on cell A2. Can anyone help me??? Please. Eric |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy macro for a list box
Prvate Sub CommandButton1_Click()
for i = 0 to Userform1.Listbox1.listcount - 1 if Userform1.Listbox1.Selected(i) then ' call Ron's macro altered to work with your data end if Next End Sub Autofilter http://www.rondebruin.nl/copy5.htm -- Regards, Tom Ogilvy "Eric" wrote: I am new to VBA and am trying to work with a Userform On my user form I have listed all contract #'s and they are not in any particular order. When I click on my userform I want to copy all the tests for the contract I highlighted to another sheet (sheet 1). How is this done? ie: contract # 123 456 789 456 123 I want every test for contract # 456 copied to sheet 1 starting on cell A2. Can anyone help me??? Please. Eric |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy macro for a list box
Tom,
The "Create a new sheet for all unique values" macro works well but I don't want to have a new sheet for every contract Number as a matter of fact I don't want the sheet to even change names. I just want to copy all the identical contract numbers to a separate sheet so that I can graph the results. Each time I transphere the information I want them to end up back on the second sheet no matter what the number is. I hope I explained what I am looking for. If I haven't I will try again. Please be patient with me. Thank you Eric "Tom Ogilvy" wrote: Prvate Sub CommandButton1_Click() for i = 0 to Userform1.Listbox1.listcount - 1 if Userform1.Listbox1.Selected(i) then ' call Ron's macro altered to work with your data end if Next End Sub Autofilter http://www.rondebruin.nl/copy5.htm -- Regards, Tom Ogilvy "Eric" wrote: I am new to VBA and am trying to work with a Userform On my user form I have listed all contract #'s and they are not in any particular order. When I click on my userform I want to copy all the tests for the contract I highlighted to another sheet (sheet 1). How is this done? ie: contract # 123 456 789 456 123 I want every test for contract # 456 copied to sheet 1 starting on cell A2. Can anyone help me??? Please. Eric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for copy to list | Excel Discussion (Misc queries) | |||
macro to copy a function down a list | Excel Programming | |||
macro to copy a function down a list | Excel Programming | |||
Need macro to copy a list of named cells between worksheets | Excel Worksheet Functions | |||
Macro to copy filtered list to new workbook. | Excel Programming |