Hi all I am very new to the vba scene! I am having trouble with this code. I have been trying to work out what is happening with it... When I press F8 there is no error code coming up but it keeps on looping in the if statements
Sub testing()
Dim ws As Worksheet
Dim xRow As Integer
xRow = 1
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "ROLES"
.Cells(1, 1).Name = "Roles"
End With
For Each ws In Application.Worksheets
If ws.Name <> Me.Name Then
xRow = xRow + 1
With ws
.Range("A1").Name = "Start_" & ws.Index
End With
End If
Next
Application.Sceeenupdating = True
End Sub



F5instead ofF8to run through the entire subroutineWith MeandIf ws.Name <> Me.Name Thenand then onApplication.Sceeenupdating = TrueF5? There are a few ways to do this. I would comment out the.Rangeline. Or I would put a print statement at the.Rangeline with the xRow and ws name