For starters, you have:
LR = .Cells(1, .Columns.Count).End(xlToLeft).Column
The dots before Cells and columns requires a reference sheet, such as:
With Sheet1
.....LR = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
However, you also have:
Dim LR As String
so that you are trying to find the number of the last column and return it as a string value (the number 10 is not the string "10")
Next, you have:
If (LR.Text = "Yes") Then...
Which is trying to treat LR as a range variable so that you can test the value of the cell, but LR is a string and has no .Text property to access, it only holds the number of the last column as string data.
You have two instances of similar mistakes:
With WorkProWS
For Each Wk In Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(3))
The WITH statement says you are working with WorkProWS and the dots before Cells (.Cells) refers to that sheet, however, you don't preceed Range or Rows with a dot so that they may, or may not refer to that sheet. If it's the active sheet, they will. If some other sheet is active, Range and Rows.Count will refer to it instead.
You have two additional With blocks within the first one. You can't, generally do that because each must refer back to the first. In this case they are independent worksheets.
Bookmarks