Excel Formula

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,501
Office Version
  1. 2016
Platform
  1. Windows
Hello Friends,

I am using this formula in a worksheet on 120 cells. And the sheets is set to hide/unhide rows based on the results.
The formula is giving correct result but it is taking 4 to 5 seconds for the sheet to hide/unhide rows.

Can anyone pls suggest another option that I could replace the below formula with which would work faster

Excel Formula:
=SUMPRODUCT(SUMIFS(r_daily_production_cutting,r_daily_production_po,$U$8:$U$22,r_daily_production_date,$B228))

Regards,

Humayun
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Only viewing the code is it possible to analyze.
In VBA a basic tip is to include
at start:
application.screenupdating=false
at end:
application.screenupdating=true
 
Upvote 0
Only viewing the code is it possible to analyze.
sure, why not

VBA Code:
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect Password:="merchant"
Worksheets("CURRENT PRODUCTION STATUS").EnableCalculation = True
  Range("A1", Range("A" & Rows.Count).End(xlUp)).AutoFilter 1, "1", , , 0
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Range("C32").ClearContents
Range("A:T").Select 'set range zoom
ActiveWindow.Zoom = True
Range("B7").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingRows:=True, Password:="merchant"
End Sub

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
     Application.ScreenUpdating = False
        
    If Not Intersect(Target, Range("B7, B226")) Is Nothing Then
   
    ActiveSheet.Unprotect Password:="merchant"
   
    Range("A1", Range("A" & Rows.Count).End(xlUp)).AutoFilter 1, "1", , , 0
   
    Range("C3").ShrinkToFit = True
    Range("B26:B29").ShrinkToFit = True
   
    Range("C32").ClearContents
    Target.Cells.Select
   
      ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingRows:=True, Password:="merchant"
     
    Application.ScreenUpdating = True
    End If
End Sub
 
Upvote 0
Move application.screenupdating=true to out of if/then statment.
I don't see what can be more optimized, perhaps the formulas in the cells are complex.
Maybe someone else can help.
 
Upvote 0
Move application.screenupdating=true to out of if/then statment.
I don't see what can be more optimized, perhaps the formulas in the cells are complex.
Maybe someone else can help.
I Tried everything but to no avail

Maybe some other member can shed some light on the issue

Thanks for your time
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top