ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Double Quote Leading to Apostrophe Problem (https://www.excelbanter.com/excel-programming/351641-double-quote-leading-apostrophe-problem.html)

ToferKing

Double Quote Leading to Apostrophe Problem
 
I am writing VB code lines like this:

Range("m6").Select
ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

When I go to the workbook and run this code I end up with an error in cell
M6 telling me that I have a Name problem.

The actual entry that is dumped into cell M6 is:

=TEXT('L6', "0.00")

Truly! The L6 has an apostrophe preceeding it and behind it. If I edit the
cell and remove the apostrophes then cell M6 has the correct formula in it.

Why are the double quotes leading to an apostrophe problem with the cell
reference of L6? What do I need to change in my coding to make this problem
go away?



Don Guillett

Double Quote Leading to Apostrophe Problem
 
try

Sub putvalue()
With Range("m6")
..Value = Range("L6")
..NumberFormat = ("0.00")
End With
End Sub
--
Don Guillett
SalesAid Software

"ToferKing" wrote in message
...
I am writing VB code lines like this:

Range("m6").Select
ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

When I go to the workbook and run this code I end up with an error in cell
M6 telling me that I have a Name problem.

The actual entry that is dumped into cell M6 is:

=TEXT('L6', "0.00")

Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
the
cell and remove the apostrophes then cell M6 has the correct formula in
it.

Why are the double quotes leading to an apostrophe problem with the cell
reference of L6? What do I need to change in my coding to make this
problem
go away?





Norman Jones

Double Quote Leading to Apostrophe Problem
 
Hi ToferKing,

Try:

ActiveCell.Formula = "=TEXT(L6, ""0.00"")"


---
Regards,
Norman



"ToferKing" wrote in message
...
I am writing VB code lines like this:

Range("m6").Select
ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

When I go to the workbook and run this code I end up with an error in cell
M6 telling me that I have a Name problem.

The actual entry that is dumped into cell M6 is:

=TEXT('L6', "0.00")

Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
the
cell and remove the apostrophes then cell M6 has the correct formula in
it.

Why are the double quotes leading to an apostrophe problem with the cell
reference of L6? What do I need to change in my coding to make this
problem
go away?





ToferKing

Double Quote Leading to Apostrophe Problem
 
Yep, that did it! I dropped out R1C1 and the apostrophes went away.

Thanks ever so much.

"Norman Jones" wrote:

Hi ToferKing,

Try:

ActiveCell.Formula = "=TEXT(L6, ""0.00"")"


---
Regards,
Norman



"ToferKing" wrote in message
...
I am writing VB code lines like this:

Range("m6").Select
ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

When I go to the workbook and run this code I end up with an error in cell
M6 telling me that I have a Name problem.

The actual entry that is dumped into cell M6 is:

=TEXT('L6', "0.00")

Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
the
cell and remove the apostrophes then cell M6 has the correct formula in
it.

Why are the double quotes leading to an apostrophe problem with the cell
reference of L6? What do I need to change in my coding to make this
problem
go away?






ToferKing

Double Quote Leading to Apostrophe Problem
 
Thanks, Don. I will try that one too!

Thanks ever so much.

Christian

"Don Guillett" wrote:

try

Sub putvalue()
With Range("m6")
..Value = Range("L6")
..NumberFormat = ("0.00")
End With
End Sub
--
Don Guillett
SalesAid Software

"ToferKing" wrote in message
...
I am writing VB code lines like this:

Range("m6").Select
ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

When I go to the workbook and run this code I end up with an error in cell
M6 telling me that I have a Name problem.

The actual entry that is dumped into cell M6 is:

=TEXT('L6', "0.00")

Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
the
cell and remove the apostrophes then cell M6 has the correct formula in
it.

Why are the double quotes leading to an apostrophe problem with the cell
reference of L6? What do I need to change in my coding to make this
problem
go away?







All times are GMT +1. The time now is 02:22 PM.

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