ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Newbie: (https://www.excelbanter.com/excel-programming/314971-newbie.html)

Rich[_16_]

Newbie:
 
I am using Excel 97.


I have the following task. I wanted to ask first before I try it.

I need to create a screen. The screen will have two list boxes. One
list is will have a list of available spreadsheets to be processed.
The next list box will be empty.

The user needs the ability to move the spreadsheets in the "To Be
Done" list over to the empty list box. The end user wants a command
button and the ability to drag and drop. Then when the user moves over
the spreadsheets to the "To Be Done List" list box. They hit a command
button that will trigger a macro that will run against the files in
the "To Be Done " list box.

The point is to create a list of file names to apply the macro to from
an available list.

Is this possible in Excel 97.

Bob Phillips[_6_]


 
Rich,

The drag and drop might be a bit tricky, but have a couple of buttons tp
swap items is easy, and a button to run a macro is easy.

Here's a starter for the move code

Private Sub CommandButton1_Click()
Dim i As Long

With Me
For i = .ListBox1.ListCount - 1 To 0 Step -1
If .ListBox1.Selected(i) Then
.ListBox2.AddItem .ListBox1.List(i)
.ListBox1.RemoveItem i
End If
Next i
End With
End Sub

Private Sub CommandButton2_Click()
Dim i As Long

With Me
For i = .ListBox2.ListCount - 1 To 0 Step -1
If .ListBox2.Selected(i) Then
.ListBox1.AddItem .ListBox2.List(i)
.ListBox2.RemoveItem i
End If
Next i
End With
End Sub


--

HTH

RP

"Rich" wrote in message
om...
I am using Excel 97.


I have the following task. I wanted to ask first before I try it.

I need to create a screen. The screen will have two list boxes. One
list is will have a list of available spreadsheets to be processed.
The next list box will be empty.

The user needs the ability to move the spreadsheets in the "To Be
Done" list over to the empty list box. The end user wants a command
button and the ability to drag and drop. Then when the user moves over
the spreadsheets to the "To Be Done List" list box. They hit a command
button that will trigger a macro that will run against the files in
the "To Be Done " list box.

The point is to create a list of file names to apply the macro to from
an available list.

Is this possible in Excel 97.





All times are GMT +1. The time now is 11:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com