ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change formula dynamically (https://www.excelbanter.com/excel-programming/403062-change-formula-dynamically.html)

geebee

change formula dynamically
 
hi,

i have the following in a cell:

=pivot!$D$70
so the cell is formattd as a percentage, like 3.0%

i would like to know if there is a way i can change this dynamically using
VBA, so it would read like *3.0%

I tried sheets("sheetname").range("C1").formula = "*" & "=pivot!$D$70" but
this did not work.

Im not sure how to make this work.

Thanks in advance,
geebee



Gary''s Student

change formula dynamically
 
After the formula goes in:

sheets("sheetname").range("C1").NumberFormat = """*""0.0%"
--
Gary''s Student - gsnu200761


"geebee" wrote:

hi,

i have the following in a cell:

=pivot!$D$70
so the cell is formattd as a percentage, like 3.0%

i would like to know if there is a way i can change this dynamically using
VBA, so it would read like *3.0%

I tried sheets("sheetname").range("C1").formula = "*" & "=pivot!$D$70" but
this did not work.

Im not sure how to make this work.

Thanks in advance,
geebee




All times are GMT +1. The time now is 03:40 AM.

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