Author: Oscar Cronquist Article last updated on January 09, 2018

In a previous post I described how to simplifiy data entry. Now it is time to put values in separate categories.

VBA code

Sub EnterName()
Dim col, Lrow As Single
Dim tmp As String
col = Application.WorksheetFunction.Match(Range("C2"), Range("B4:H4"), 0) - 1
tmp = Range("B" & Rows.Count).Offset(0, col).Address
Lrow = Range(tmp).End(xlUp).Row
Range("B1").Offset(Lrow, col).Value = Range("E2").Value
Range("B1").Offset(Lrow, col + 1).Value = Range("F2").Value
Range("E2").Value = ""
Range("F2").Value = ""
End Sub

Final note

My example is not the best way to organize data but it gives you a hint about the possibilities of using vba code in your workbooks. So how should the tables look like?

Download excel *.xlsm file

Categorize values from a data entry.xlsm