Forum Discussion
Mark_Chor
Jan 02, 2024Copper Contributor
Convert all sheets from entire workbook from formulae to data format
Hi. I have a need to convert ALL formulae from an entire Esxel workbook wth 130 sheets and each sheet with up to 3000 rows into data. I know how to use copy and paste/special to convert data but on...
- Jan 10, 2024
Mark_Chor To process 50 worksheets at a time with the code presented by HansVogelaar, use a For Next Loop to loop through a set number of worksheets at a time. For example, if your workbook has 130+ worksheets, you could break it up into 3 groups as follows:
Sub Formulas2ValuesGroup1() Dim i As Long For i = 1 To 50 With ThisWorkbook.Worksheets(i).UsedRange .Value = .Value End With Next i End Sub Sub Formulas2ValuesGroup2() Dim i As Long For i = 51 To 100 With ThisWorkbook.Worksheets(i).UsedRange .Value = .Value End With Next i End Sub Sub Formulas2ValuesGroup3() Dim i As Long For i = 101 To ThisWorkbook.Worksheets.Count With ThisWorkbook.Worksheets(i).UsedRange .Value = .Value End With Next i End SubAlso worth noting, since you're experiencing an "Out of memory" issue, it's a good idea to close all other applications, as well as any other Excel workbooks, in order to free up as much memory as possible.
Mark_Chor
Jan 10, 2024Copper Contributor
Thx very much. Learned a lot from you.
Pls also see suggestion from djclements to me. Definitely more elegant than what I last suggested. His method is a far better one than mine. For example I don't have to enter names of sheets. 🙂
Have a good day.
Mark
Pls also see suggestion from djclements to me. Definitely more elegant than what I last suggested. His method is a far better one than mine. For example I don't have to enter names of sheets. 🙂
Have a good day.
Mark
HansVogelaar
Jan 10, 2024MVP
If djclements's reply solved your problem, please mark it as the answer. That will be useful to others who read this topic.
- Mark_ChorJan 10, 2024Copper ContributorTried it once. Worked like a charm. Will confirm by running it in another spreadsheet. Will mark it as the answer then if similar. You folks are awesome.
Thanks again.
Mark- Mark_ChorJan 12, 2024Copper ContributorHi
Tried it several times. Most worked like a charm. Most finished in a matter of a second or 2. Sometimes I encountered out of memory error but I can live with it. I am happy happy 🙂
As you recommended I placed "Best respond" to djclements's response.
Have a great day. Happy programming
Mark