VBA Code to switch view

A

Adrian

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..
 
N

Norman Jones

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
 
D

Dana DeLouis

displays the formula instead of the evaluated values?

One way...

With ActiveWindow
.DisplayFormulas = Not .DisplayFormulas
End With

HTH
Dana DeLouis
 
Top