Is it possible to use TRIM where the field lengths are not consistent? I need to remove the first character of a field but the length varies between 4 and 8 characters, so wondered what the options were please.
Thanks for the reply. I am still not getting the results I need so I wondered if the range definition is something to do with it.
This code works, but only on fixed length, so how can I amend to include variable length of characters please?
Dim MyTrim As Range
Dim MyTop As Range
Set MyTrim = Range(“d2:d2001”)
For Each MyTop In MyTrim
MyTop = “=RIGHT(RC,4)”
Try put MyTop = MID(MyTop, 2)
This will set MyTop to equal the 2nd character up until the end character, as when you don't specifiy number of chars in the MID function it will go to the end of the string (in VBA not Excel)
That is going to produce a specific number of characters because you ask it to produce a specific number of characters, ie 4. It is also very different to what you asked for in the first place and ignores the replies you had. You also dont need to use a loop to place a formula into a range of cells.