JonElCanche
Board Regular
- Joined
- Aug 25, 2011
- Messages
- 59
Below is the loop. An error occurs at Rows("y:y").Select
The y value that would be found in cell C500 would always match the row that would be selected and deleted. For example if cell C500 had the value 13, I would want Rows("13:13").select and then deleted. Any ideas?
Sub Macro2()
'
' Macro2 Macro
'
'
For y = 1 To 100
If Range("c500").Value = y Then
Rows("y:y").Select
Selection.Delete Shift:=xlUp
Sheets("Dashboard").Select
End If
Next y
End Sub
The y value that would be found in cell C500 would always match the row that would be selected and deleted. For example if cell C500 had the value 13, I would want Rows("13:13").select and then deleted. Any ideas?
Sub Macro2()
'
' Macro2 Macro
'
'
For y = 1 To 100
If Range("c500").Value = y Then
Rows("y:y").Select
Selection.Delete Shift:=xlUp
Sheets("Dashboard").Select
End If
Next y
End Sub