Hi all,
I need some help, the more I try the worse my code gets
What I'm trying to accomplish is
1. look through all open workbook for one that has "connect" in the name.
2. look through all open worksheets in the "connect" workbook and name myrange to the sheet that begins with "KPI"
Am I even close?
Thank you
I need some help, the more I try the worse my code gets
What I'm trying to accomplish is
1. look through all open workbook for one that has "connect" in the name.
2. look through all open worksheets in the "connect" workbook and name myrange to the sheet that begins with "KPI"
Am I even close?
VBA Code:
Dim wb As Workbook
Dim ws As Worksheet
For Each wb In Workbooks
If wb.Name Like "*connect*" Then
For Each ws In Worksheets
If ws.Name Like "KPI*" Then
Set myrange = wb.ws
End If
Next ws
End If
Next wb
With myrange
.Range("A1:P20").Select
End With
Thank you