I am trying to run a simple operation on a column of data in Excel VBA. If a cell in column B starts with a letter before ‘N’, nothing happens to the cell. If the cell starts with a letter ‘N’ or later (in the alphabet), it replaces the cell contents with “!!!!!”.
Here is my code that correctly applies this to another column:
Range("C1", Range("C1").End(xlDown)).Value = "=IF(LEFT(A1,1)<""N"",B1,""!!!!!"")"
This works fine, and makes column C contain the correct output. However, in order to replace column B, I then need to convert column C to literal values, and then delete all of column B.
These extra steps seem a little unnecessary and cumbersome. Is there a way of applying the formula straight over column B, without needing to assign a the values to a separate column and then destroying the original column B?
Set myRng to whatever amount of rows you need. It doesn’t seem to work with a complete column.