While I’m thinking about this stuff, I’d like to share a few simple tips for speeding up your Excel VBA code. So feel free to comment and share any other performance tips you may have.Each time a cell that affects any formula in your spreadsheet is changed or manipulated, Excel recalculates the entire worksheet.Activate n File Num = Free File Open csv Path & "\" & _ ws Sheet. Name & ".csv" For Output As #n File Num Export To Text File CStr(n File Num), Sep, False Close n File Num Next ws Sheet End Sub Public Sub Export To Text File(n File Num As Integer, _ Sep As String, Selection Only As Boolean) Dim Whole Line As String Dim Row Ndx As Long Dim Col Ndx As Integer Dim Start Row As Long Dim End Row As Long Dim Start Col As Integer Dim End Col As Integer Dim Cell Value As String Application. When a workbook is in manual calculation mode, the workbook will not recalculate until you explicitly trigger a calculation.The idea is to place Excel into manual calculation mode, run your code, and then switch back to automatic calculation mode.In worksheets that have a large amount of formulas, this behavior can drastically slow down your macros.If your workbook is formula intensive, you may not want Excel to trigger a recalculation every time a cell value is altered by your macro. Calculation property to tell Excel to switch to manual calculation mode.
Nothing will be exported.") Exit Sub End If For Each ws Sheet In Worksheets ws Sheet. Comparing two excel sheets becomes very useful and handy when there are thousand of entries to be compared. Why to waste hours doing this tedious & not so interesting activity? Status Bar = "Comparing cells " & Format(i / max R, "0 %") & "..." For r = 2 To lr2 cf1 = "" cf2 = "" On Error Resume Next cf1 = ws1. Count End With max R = lr1 max C = lc1 If max R < lr2 Then max R = lr2 If max C < lc2 Then max C = lc2 Diff Count = 0 For c = 1 To max C For i = 2 To lr1 diff B = True Application.