Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could try this
Sub populateSecondCol() dim amountOfParts as Long amountOfParts = Sheets("SheetName").Range("A65535").End(xlUp).Row for i = 1 to amountOfParts Sheets("SheetName").Cells(i, 2).Value = Mid(Sheets("SheetName").Cells(i, 1).Value, 1, 4) next i End sub I'm thinking there will be a better way to do this, especially because there are so many parts to check, possibly some special excel functions to use. But this does the trick if no-one else offers a better solution (which I'm sure they will) "Bob" wrote: I have a part list which I update monthly. In most cases the part numbers are 10+ characters long however after the first 3 or 4 characters I can determine what kind of part it is. What I would like to do is create a macro that based on the first 3 to 4 characters would populate the product category field in the second column. For example part number DF24-10W52-08LPHHN in column "A" would equal product Category in Column "B". I would just use DF24 in the macro. Also my part list is about 40,000 lines. Thanks. -- Bob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need help to have macro populate a column with formula to end ofcolumn. | Excel Programming | |||
To populate a column with a date | Excel Programming | |||
Populate columns in one column one after one | Excel Programming | |||
Populate a column by extracting unique values from another column? | Excel Worksheet Functions | |||
Write a macro to populate a column with a formula | Excel Programming |