본문 바로가기

Computer/Excel

VBA 엑셀 모든 시트의 함수를 값으로 변경

Developer > Visual Basic > Insert > Module > 아래값 복사하여 붙여넣기 > F5

 

Sub FormulaToValue()
WCount = Worksheets.Count
For i = 1 To WCount
If Worksheets(WCount - i + 1).Visible Then
Worksheets(WCount - i + 1).Select
RCount = ActiveCell.SpecialCells(xlLastCell).Row
CCount = ActiveCell.SpecialCells(xlLastCell).Column
a = Cells(1, 1).Resize(RCount, CCount).Value
Cells(1, 1).Resize(RCount, CCount) = a
End If
Next i
End Sub

 

'Computer > Excel' 카테고리의 다른 글

Excel macro send key  (0) 2021.12.28
Excel macro - Visual Basic loop  (0) 2021.10.04