Hello, I am using the code below to transfer some data between worksheets, and it works fine. I had the code set to a specific value but I was having to tweak the code every now and then so that the user could change the trigger point. I figured it would be easier on both of us if I just added a cell to the worksheet so that the user could change the setpoint on the fly. So I added a new WS called "Coding" and assigned cell C2 for that. I get no error messages but the code does not transfer the data as it did before. Can anyone tell me what I did wrong, I am missing something simple I know - Thank you,
VBA Code:
Sub CopyEpipro()
Dim c As Range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
Dim setpoint As Integer 'I added this
Set Source = ActiveWorkbook.Worksheets("EPIPRO")
Set Target = ActiveWorkbook.Worksheets("Export")
setpoint = ActiveWorkbook.Worksheets("Coding").Range("C2") ' I added this
j = 45 ' Start copying to row 1 in target sheet
For Each c In Source.Range("H5:H12") ' The column for the micron reading
If c >= setpoint Then 'this was "if>= 2900 then" before I tried to add the setpoint variable
Source.Rows(c.Row).Copy Target.Rows(j)
j = j + 1
End If
Next c
End Sub