adamprocter
Board Regular
- Joined
- Apr 13, 2015
- Messages
- 53
I am trying to press a button on main sheet that looks across all my sheets and finds the last value in Col I and
When that value is greater than 20 I want to copy that sheet name and paste into my main sheet
I think I'm close but no error but nothing is being pasted...
When that value is greater than 20 I want to copy that sheet name and paste into my main sheet
I think I'm close but no error but nothing is being pasted...
Code:
Dim SheetName As Worksheet
Dim ws1 As Worksheet
Dim rcMatch As Variant
Dim LastRow As Long
Set ws1 = ThisWorkbook.Worksheets("Execution Screen (login)")
For Each SheetName In Worksheets
If Cells(Rows.Count, "I").End(xlUp).Value > "20" Then
'copy and paste sheetname
SheetName.Select
'paste into O6,O8,O10 depending on how many found
Sheets("Execution Screen (login)").Range("O6").Paste
End If
Next SheetName
Last edited: