Hi there,
I have tried searching other threads but they were all too old and didn't really answer my problem...
I have a command button that when i click it needs to insert a formula into a target cell, i have done this with another button in the same sheet and it works fine but VBA has a problem with the commas in the formula and I don't know how to get around it...
The D7 formula works perfectly but the D15 formula is having a paddy. Any help would be greatly appreciated. I'm sure its a problem with my formula rather than VBA but i've tried a few things and i just can't get it to do what i need it to do.
Thank you.
I have tried searching other threads but they were all too old and didn't really answer my problem...
I have a command button that when i click it needs to insert a formula into a target cell, i have done this with another button in the same sheet and it works fine but VBA has a problem with the commas in the formula and I don't know how to get around it...
VBA Code:
Private Sub CommandButton1_Click()
Range("A2").Value = Range("R1").Value
Range("D7").Formula = "=LEFT(D15,6)&(RIGHT(B3,6))"
Range.("D15").Formula = "=UPPER(LEFT(SUBSTITUTE(LEFT(A10,FIND(",",A10&",")-1)," ",""),6))"
End Sub
The D7 formula works perfectly but the D15 formula is having a paddy. Any help would be greatly appreciated. I'm sure its a problem with my formula rather than VBA but i've tried a few things and i just can't get it to do what i need it to do.
Thank you.