ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Code to switch view (https://www.excelbanter.com/excel-programming/308277-vba-code-switch-view.html)

Adrian[_7_]

VBA Code to switch view
 
Hi,

Can someone tell me how do I switch view using VBA so that the cells
displays the formula instead of the evaluated values? Also, how do i set the
width of cell columns ? Thanks..


--
Regards,
Adrian



Norman Jones

VBA Code to switch view
 
Hi Adrian,

Can someone tell me how do I switch view using VBA so that the cells
displays the formula instead of the evaluated values?


ActiveWindow.DisplayFormulas = True

Also, how do i set the width of cell columns ?


To set the width of column A to 20:

Worksheets("Sheet1").Columns("A:A").ColumnWidth = 20

To autofit columns A to D:

Worksheets("Sheet1").Columns("A:D").AutoFit


---
Regards,
Norman



"Adrian" wrote in message
...
Hi,

Can someone tell me how do I switch view using VBA so that the cells
displays the formula instead of the evaluated values? Also, how do i set

the
width of cell columns ? Thanks..


--
Regards,
Adrian





Dana DeLouis[_3_]

VBA Code to switch view
 
displays the formula instead of the evaluated values?

One way...

With ActiveWindow
.DisplayFormulas = Not .DisplayFormulas
End With

HTH
Dana DeLouis


"Adrian" wrote in message
...
Hi,

Can someone tell me how do I switch view using VBA so that the cells
displays the formula instead of the evaluated values? Also, how do i set

the
width of cell columns ? Thanks..


Regards,
Adrian





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

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