Created
January 28, 2014 04:17
-
-
Save hafuu/8662191 to your computer and use it in GitHub Desktop.
数式を展開するマクロ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub expandAll() | |
| Dim sw | |
| sw = Timer | |
| Dim ss | |
| Set ss = Sheets | |
| For i = 1 To ss.Count | |
| Dim s | |
| Set s = ss(i) | |
| Dim orig | |
| orig = s.EnableCalculation | |
| s.EnableCalculation = False | |
| Dim used | |
| Set used = s.Range(s.PageSetup.PrintArea) | |
| Dim cols | |
| Dim rows | |
| cols = used.Columns.Count | |
| rows = used.rows.Count | |
| For Row = 1 To rows | |
| For col = 1 To cols | |
| Dim c | |
| Set c = used.Cells(Row, col) | |
| If c.HasFormula Then | |
| c.Formula = c.Text | |
| End If | |
| Next col | |
| Next Row | |
| s.EnableCalculation = orig | |
| Next i | |
| Application.StatusBar = Timer - sw | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment