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 Sub
Also 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.
Patrick2788
Jan 09, 2024Silver Contributor
Have you tried first grouping all sheets in the workbook before doing the usual copy/paste values? It might be a challenge to complete the operation memory-wise but worth a try.
- Mark_ChorJan 10, 2024Copper ContributorPatrick2788
I did try with no success. Using Excel 365 for Mac, and macOS Sonoma 14.1.2 I tried but failed to group all sheets in the workbook as you suggested. In fact I could not even choose 2 sheets prior to copy and paste. On the Net, some contributors did suggest and showed on YouTube how to do it but I suspect it was through using non-Mac Excels. If you can suggest how to do it using Mac Excel I'd be grateful.
I tried the kind suggestion by HansVogelaar of running the Macro called "Formulas2Values()" on a much smaller document with only several sheets and it worked like magic. As I mentioned in this forum previously, and Hans appeared to agree that trying on my huge file was limited by memory. I might explore chopping up my doc into 3 or 4 , i.e. may be 30 sheets each, and then run the "Formulas2Values()" macro.
Thank you so much for your kind suggestion. Have a great day. Happy programming.
Mark Chor