Selected Answer
Kalil
To get the file selected in ComboBox 2 into Label1, you can use this:
Private Sub ComboBox2_Change()
Dim folderspec As String
folderspec = "D:\All website photo" & "\" & ComboBox1.Value
UserForm1.Label1.Caption = folderspec & "\" & ComboBox2.Value
End Sub
but I've removed the second loop in the ComboBox1 code and provided code to expand the ComboBox2 list (once Combobox1 has a folder selected):
Private Sub ComboBox1_Change()
Dim fs, f, f1, fc, s
Dim folderspec
folderspec = "D:\All website photo" & "\" & ComboBox1.Value
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
ComboBox2.Clear
For Each f1 In fc
ComboBox2.AddItem f1.Name
Next f1
ComboBox2.SetFocus 'get into CB2...
'Application.SendKeys "^{F4}"
Application.SendKeys "%{down}" ' and expand list
End Sub
It's a bit unusual to open a file from a label (I'd normally use a CommandButton to do that) but if you do, the FollowHyperlink method will fail if there are spaces in the full file path. This code replaces them with %20 so the file will open:
Private Sub Label1_Click()
On Error Resume Next
'swap spaces in file path/name and open in new window
ThisWorkbook.FollowHyperlink (Replace(UserForm1.Label1, " ", "%20"))
End Sub
Not sure what your SpinButtons are for but hopefully this answered your question. The attached file includes the modified code above.