Here is what I am trying to do. I am searching through column D of a spreadsheet for a value in cell L8. There may be multiple instances of the value in column D. When I find an instance, I need to check if column I of the same row is not blank. If it is not then I need to get the value from column A of the row and copy it into cell L13. I will need to repeat this through column AF, and then down to L16 and so on so dynamic code is necessary. I can not figure out how to do the offset from the current Search variable cell to load the value from column A. I added the InDiameter variable and tried to give it the value of Search but it does not seem to like that. I tried to declare it as Range and get errrors. This is just the beginning of a much more elaborate set of code but it is hanging me up from moving forward.
Please help!
John
Code:
Sub Production_Plan()
'Find incoming diameter
Dim FoundCell As Range
Dim Search As String
Dim InDiameter As String
Search = Sheets("Inventory").Range("$L$8")
InDiameter = Search
Set FoundCell = Sheets("Inventory").Columns(4).Find(Search, LookIn:=xlValues, LookAt:=xlWhole)
'Check Coil Status and assign to machine
If Not FoundCell Is Nothing Then
FoundCell.Activate
If (ActiveCell.Offset(0, 5) = "") Then
Range("InDiameter").Offset(5, 0) = ActiveCell.Offset(0, -3)
End If
End If
End Sub
Please help!
John