Importing Inventory Records

SOLVED

When attempting to import inventory records we get an error "Category Cannot Be Blank"  We have an entry in the category field.  We even updated the inventory record with the value manually and then again attempted to import and we still get the error.  We created new category fields 10, 90, 96 and now the items that we did not modify with the CONV code also give us this error.

  • 0
    verified answer

    Importing from Excel? Force the category field to be a text field by prefixing the value with an apostrophe ('10 instead of just 10). Also do not leave any fields blank - use a space.

  • 0 in reply to Ettienne Schwagele
    The following trick is very helpful if you have a large number of records. Replace "K2:K5000" with the appropriate column and row values.

    >>
    How to prepend an apostrophe to all cells in a column.


    stackoverflow.com/.../adding-appostrophe-in-every-field-in-particular-column-for-excel
    I'm going to suggest the non-obvious. There is a fantastic (and often under-used) tool called the Immediate Window in Visual Basic Editor. Basically you can write out commands in VBA and execute them on the spot, sort of like command prompt. It's prefect for cases like this.

    Press ALT+F11 to open VBE, then Control+G to open the Immediate Window. Type the following and hit enter:

    for each v in activesheet.range("K2:K5000") : v.value = "'" & v.value : next


    And boom! You are all done. No need to create a macro, declare variables, no need to drag and copy, etc. Close the window and get back to work. Only downfall is to undo it, you need to do it via code since VBA will destroy your undo stack (but that's simple).
    <<