Hi,
I'm very new to VBA and have tried to solve this (have read many threads here) in the last couple of days but have not been able. I hope you fine folks are willing to point out where I'm going wrong.
Context:
I've got a spreadsheet with items in rows 5-713 down column B(merged up to cell J) where for each date (Columns K-SP) the item is scored either a 1 or a 0. My goal is to create a list at the bottom of the worksheet that contains all items which have gone from 1 to 0. To start, I've simply been trying to get my "generate list" button to copy all rows with a 0 in them to the bottom, figuring I would tweak it later to do exactly what I wanted. I've tried several things and gotten several different errors.
Here is my code so far, and (I think) the closest I've come.
The error I get with this attempt is "out of memory". Several other attempts have given me "method 'range of object' _Worksheet failed".
Any help to figure out this first step, or even how to have it scan for 1's that turn to 0's would be wonderfully appreciated. I'm sure I'm missing something simple and hope you guys can forgive my ignorance of all things coding.
Thanks!
I'm very new to VBA and have tried to solve this (have read many threads here) in the last couple of days but have not been able. I hope you fine folks are willing to point out where I'm going wrong.
Context:
I've got a spreadsheet with items in rows 5-713 down column B(merged up to cell J) where for each date (Columns K-SP) the item is scored either a 1 or a 0. My goal is to create a list at the bottom of the worksheet that contains all items which have gone from 1 to 0. To start, I've simply been trying to get my "generate list" button to copy all rows with a 0 in them to the bottom, figuring I would tweak it later to do exactly what I wanted. I've tried several things and gotten several different errors.
Here is my code so far, and (I think) the closest I've come.
Code:
Private Sub CommandButton1_Click()
Dim y As Integer, z As Integer
y = 5
z = 714
Do Until y = 713
If Range("By:SPy").Value = 0 Then Range("By:SPy").Copy Range("Bz")
y = y + 1
z = z + 1
Loop
End Sub
The error I get with this attempt is "out of memory". Several other attempts have given me "method 'range of object' _Worksheet failed".
Any help to figure out this first step, or even how to have it scan for 1's that turn to 0's would be wonderfully appreciated. I'm sure I'm missing something simple and hope you guys can forgive my ignorance of all things coding.
Thanks!