gaj104
Well-known Member
- Joined
- Nov 9, 2002
- Messages
- 864
Hi I'm having a problem with this code I made. I know I need to put a with sheets statement but unsure how do do this.
I'd really appreciate some help.
I'm using
It will select the sheet if I have put a Y next to the sheet name.
Thanks
I'd really appreciate some help.
I'm using
Code:
Sub PrintPack()
Dim lRow As Long
Dim sName As String
Dim ws As Worksheet
Set ws = Sheets("Print_Split")
lRow = ws.UsedRange.Rows.Count
For i = 2 To lRow
If ws.Range("B" & i).Value = "Y" Then
Sheets(ws.Range("A" & i).Value).Select
End If
Next i
End Sub
It will select the sheet if I have put a Y next to the sheet name.
Thanks