Sub MoveData()
Sheets("Grain2").Cells.ClearContents
Sheets("Hop2").Cells.ClearContents
DestnColumn = 1
For Each are In Sheets("Recipe").Columns(1).SpecialCells(xlCellTypeConstants, 2).Areas
'are.Select
GrainDestnRow = 1: HopDestnRow = 1
For Each cll In are.Columns(1).Cells'deals with he merged cells (try not to use merged cells with VBA - they're very hard work!)
'cll.Select
CurrentItem = Application.Trim(cll.Value)
Set GrainFound = Sheets("Inputs").Columns(1).Find(what:=CurrentItem, lookat:=xlWhole, LookIn:=xlFormulas, searchformat:=False)
If Not GrainFound Is Nothing Then
Sheets("Grain2").Cells(GrainDestnRow, DestnColumn) = CurrentItem
GrainDestnRow = GrainDestnRow + 1
End If
Set HopsFound = Sheets("Inputs").Columns(3).Find(what:=CurrentItem, lookat:=xlWhole, LookIn:=xlFormulas, searchformat:=False)
If Not HopsFound Is Nothing Then
Sheets("Hop2").Cells(HopDestnRow, DestnColumn) = CurrentItem
HopDestnRow = HopDestnRow + 1
End If
Next cll
DestnColumn = DestnColumn + 1
Next are
End Sub
Problems:
Merged columns A and B in Recipe sheet
Several syntax errors (Recipe instead of Sheets)
Names of variables not consistent.
For this last, I should have included some Dim statements at the top of the sub's code as well as a single Option Explicit line at the top of the code module:
Dim DestnColumn, are, GrainDestnRow, HopDestnRow, cll, CurrentItem, GrainFound, HopsFound
and this would have shown up spelling differences.