I would like to make every string in a column lowercase and remove all spaces. But I would like to refer to the column name in the code not the column number (because it can vary, I would like to use the code on other sheets where the column has the same name, but is not in same place). The data in the sheet looks as follows (simple example):
| furniture | color | amount |
|---|---|---|
| chair | Pink | 2 |
| sofa | pin k | 1 |
| table | bLue | 1 |
| sofa | 1 |
So row 1 is actually the header. I would like to lowercase and remove spaces for the values in column 'color'
I tried
For Each cell In Column('color').cells
cell.Value = LCase(cell.Value)
Next cell
Can't even seem to get the loop right
Does anybody have suggestions? Thanks in advance