Hi all,
Havethe following which works fine as a formula in the workbook:
Range("AD2") = "=DATEVALUE(TRIM(MID(AE2,FIND(" ",AE2),3))&" "&LEFT(AE2,FIND(" ",AE2)-1)&" "&TRIM(MID(AE2,FIND(" ",AE2,FIND(" ",AE2)+1),5)))"
However, if I try and use it in VBA I am getting a syntax error (expected End of Statement) highlighted in the section ,AE2),3))&".
Not sure what is happening as if I put it in the workbook I can copy down quite happily. Just not when trying to do it programmatically.
My head hurts
Any help appreciated.
Thanks
DaveA
Havethe following which works fine as a formula in the workbook:
Range("AD2") = "=DATEVALUE(TRIM(MID(AE2,FIND(" ",AE2),3))&" "&LEFT(AE2,FIND(" ",AE2)-1)&" "&TRIM(MID(AE2,FIND(" ",AE2,FIND(" ",AE2)+1),5)))"
However, if I try and use it in VBA I am getting a syntax error (expected End of Statement) highlighted in the section ,AE2),3))&".
Not sure what is happening as if I put it in the workbook I can copy down quite happily. Just not when trying to do it programmatically.
My head hurts

Any help appreciated.
Thanks
DaveA
Last edited: