View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Sheet names in a drop down

Hi Howard,

Am Fri, 18 Nov 2016 08:09:30 +0100 schrieb Claus Busch:

your drop down in Sheet1 cell A1. Then try:


sorry, I didn't read carefully.

Try:

Sub Test()
Dim varSh As Variant
Dim LRow As Long, i As Long
Dim myRng As Range
Dim myStr As String

varSh = Split(Sheets("Sheet1").Range("A1").Validation.Form ula1, ";")

For i = LBound(varSh) To UBound(varSh)
With Sheets(varSh(i))
LRow = .Cells(Rows.Count, "D").End(xlUp).Row
Set myRng = .Range("D5:D" & LRow)
'Do stuff
End With
Next
End Sub

Check out what separator you have in the validation list. In german
system it is a semicolon. Perhaps it is a comma in your system.


Regards
Claus B.
--
Windows10
Office 2016