Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default F.A.O Mike H

Hi Mike,
You gave me the code as attached below for listing the
contents of a folder:

Private Sub Worksheet_Activate()
ListBox1.Clear
MyPath = "C:\"
MyName = Dir$(MyPath & "*.xls") 'only looks for xl files
With ListBox1
Do While MyName < ""
MyName = Left(MyName, Len(MyName) - 4) 'removes .XLS from end of name
..AddItem MyName
MyName = Dir
Loop
End With
End Sub

The List box will need to be generated and activated only when the user
selects Sheet1.Range("D7")
Could this be added to an existing routine below - and if so how would I go
about doing it.......

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Lastrow As Integer

If Target.Cells.Count 1 Then
Exit Sub
End If

Lastrow = Sheets("sheet1").Cells(Rows.Count, "Y").End(xlUp).Row

If Not Application.Intersect(Range("I7"), Target) Is Nothing Then

With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$Y$3:$Y" & Lastrow
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
End If

' Enter new code here

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! MIKE H Wu Excel Discussion (Misc queries) 3 November 9th 08 05:41 PM
FOR MIKE H. doss04 New Users to Excel 5 October 12th 08 12:45 PM
I need you Mike H! jessshouse Excel Worksheet Functions 4 June 28th 07 04:27 PM
Thanks to Mike and Niek Otten Jester Excel Discussion (Misc queries) 0 March 4th 07 10:47 AM
Mike Window Menu Missing Excel Discussion (Misc queries) 6 March 15th 05 03:49 PM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"