I'm relatively new to VBA, and have run into a "not knowing what code I need" section. I might have used the wrong terminology in my explanation, I apologize in advance.

The gold and green on the JCX sheet is manual formatting for clarification.

For starters, the gold cell with 50 is in the correct column (CFM), but the wrong row. From the relationship in the 08-Attribute Sheet, that 50 CFM needs to be on the row with AHU-2 (along with the other values for AHU-2). I'm having issues creating this "relationship" in VBA.

After loading the first CFM value, if something relates to AHU-2, and goes in either the SP, RPM, or Motor HP columns...then that numerical value needs to go in the appropriate column in the AHU-2 row. Not the next row in the correct column.

If it's not one of those 4 "categories", then it goes in the "UDF" columns, which start at column 20. Again, keeping the relationship with the "tag", which we'll keep to AHU-2 for now.

The #### that VBA is also returning when one of those 4 main categories fails, is just a compressed #REF!. I didn't expand it before taking the screenshot.

**08-Attribute Sheet**
![08-Attribute Sheet](https://i.stack.imgur.com/Awm2u.png)

**JCX Sheet**
![JCX Sheet](https://i.stack.imgur.com/RXNca.png)

```
TagRowCounter = 2
AttributeRowCounter = 2
TagNumberRow = 2
TagValueNameColumn = 20
TagValueColumn = 21

TagRowCounter = 2
Do
    Sheets("JCX").Cells(TagRowCounter, 14).Value = Application.VLookup(Sheets("JCX").Cells(TagRowCounter, 1), Sheets("08-Attribute").Range("A:K"), 1, 0)

        If Sheets("08-Attribute").Cells(AttributeRowCounter, 9) = "CFM" Then
                Sheets("JCX").Cells(TagNumberRow, 14).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, 11).Value

            ElseIf Sheets("08-Attribute").Cells(AttributeRowCounter, 9) = "SP" Then
                Sheets("JCX").Cells(TagNumberRow, 15).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, 11).Value

            ElseIf Sheets("08-Attribute").Cells(AttributeRowCounter, 9) = "RPM" Then
                Sheets("JCX").Cells(TagNumberRow, 16).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, 11).Value

            ElseIf Sheets("08-Attribute").Cells(AttributeRowCounter, 9) = "Motor_HP" Then
                Sheets("JCX").Cells(TagNumberRow, 17).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, 11).Value

            Else
                'Tag Value Name
                Sheets("JCX").Cells(TagNumberRow, TagValueNameColumn).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, TagValueNameColumn).Value
                'Tag Value Number
                Sheets("JCX").Cells(TagNumberRow, TagValueColumn).Value = Sheets("08-Attribute").Cells(AttributeRowCounter, TagValueColumn).Value
            End If
                TagValueNameColumn = TagValueNameColumn + 2
                TagValueColumn = TagValueColumn + 2
                TagRowCounter = TagRowCounter + 1
                TagNumberRow = TagNumberRow + 1
                AttributeRowCounter = AttributeRowCounter + 1

Loop Until Sheets("08-Attribute").Cells(AttributeRowCounter, 1) = False

```