ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   syntax question (https://www.excelbanter.com/excel-programming/346765-syntax-question.html)

JT

syntax question
 
I'm having a problem with the correct syntax on the following line:

ActiveCell.Offset(0, 2).FormulaR1C1 = "=text(mid(r[]c[-1]),6,5)),""00"")"

The problem is it is putting the formula in the cell instead of the actual
value. I have tried to remove the begging and ending " but then I get an
error on the 'r[]'. I'm sure it is the syntax, I just don't know how to
correct it. Thanks for the help.....


--
JT

Bob Phillips[_6_]

syntax question
 
With ActiveCell
.Offset(0, 2).Value = Evaluate("text(mid(" & .Offset(0, -1).Address
& _
",6,5),""00"")")
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"JT" wrote in message
...
I'm having a problem with the correct syntax on the following line:

ActiveCell.Offset(0, 2).FormulaR1C1 = "=text(mid(r[]c[-1]),6,5)),""00"")"

The problem is it is putting the formula in the cell instead of the actual
value. I have tried to remove the begging and ending " but then I get an
error on the 'r[]'. I'm sure it is the syntax, I just don't know how to
correct it. Thanks for the help.....


--
JT





All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com