'For Loop' For Selected Sheets/As Named In A Range
Hi Faraz
'Loop for selected sheets
For Each shtemp In ActiveWindow.SelectedSheets
MsgBox shtemp.Name
Next
'Loop with sheets mentioned in range
For Each shtemp In ActiveWorkbook.Sheets
If WorksheetFunction.CountIf(Range("A1:A10"), _
shtemp.Name) 0 Then
MsgBox shtemp.Name
End If
Next
If this post helps click Yes
---------------
Jacob Skaria
"Faraz A. Qureshi" wrote:
Could one of you experts kindly provide a sample code so as to determine how
to carry out an exercise of "For Loop" in the following cases?
For Each "sheet in the selected sheets"
...
...
Next
and
For Each "sheet with name listed in a range (e.g. Sheet1!A1:A10)"
...
...
Next
Thanx in advance
--
Best Regards,
Faraz
|