ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help on cell formatting (https://www.excelbanter.com/excel-programming/285641-help-cell-formatting.html)

Valeria[_2_]

Help on cell formatting
 
Dear experts,
I have a procedure to insert a comment in some cells on a
worksheet.
Now, the comment text is made of a fixed text part and of
a cell value from another workbook:
Workbooks(a).Worksheets(1).Cells(i, z).AddComment "Price
is " & Workbooks(External).Worksheets(1).Cells(f, g)

My problem is that I would like to get a 2-decimal number
from the external workbook for the comment(I am getting
many more decimals!), without actually changing the cell
in the external workbook.
Can somebody please help me?
Many thanks.
Kind regards,
Valeria

wolf

Help on cell formatting
 
Hi Valeria,

you may try

Workbooks(a).Worksheets(1).Cells(i, z).AddComment "Price
is " & format(Workbooks(External).Worksheets(1).Cells(f,

g), "0.00")
(untested)

Best regards

Wolf
wlamik<atgmx.net

-----Original Message-----
Dear experts,
I have a procedure to insert a comment in some cells on a
worksheet.
Now, the comment text is made of a fixed text part and of
a cell value from another workbook:
Workbooks(a).Worksheets(1).Cells(i, z).AddComment "Price
is " & Workbooks(External).Worksheets(1).Cells(f, g)

My problem is that I would like to get a 2-decimal number
from the external workbook for the comment(I am getting
many more decimals!), without actually changing the cell
in the external workbook.
Can somebody please help me?
Many thanks.
Kind regards,
Valeria
.


Valeria[_2_]

Help on cell formatting
 
It works perfectly,
thank you very much!
Kind regards,
Valeria

-----Original Message-----
Hi Valeria,

you may try

Workbooks(a).Worksheets(1).Cells(i, z).AddComment "Price
is " & format(Workbooks(External).Worksheets(1).Cells(f,

g), "0.00")
(untested)

Best regards

Wolf
wlamik<atgmx.net

-----Original Message-----
Dear experts,
I have a procedure to insert a comment in some cells on

a
worksheet.
Now, the comment text is made of a fixed text part and

of
a cell value from another workbook:
Workbooks(a).Worksheets(1).Cells(i, z).AddComment "Price
is " & Workbooks(External).Worksheets(1).Cells(f, g)

My problem is that I would like to get a 2-decimal

number
from the external workbook for the comment(I am getting
many more decimals!), without actually changing the cell
in the external workbook.
Can somebody please help me?
Many thanks.
Kind regards,
Valeria
.

.



All times are GMT +1. The time now is 11:01 PM.

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