calculation VBA and merge 2 VBA code.

Status
Not open for further replies.

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
359
Office Version
  1. 2021
Platform
  1. Windows
dear Sir/madam,

I have 3 sheet in my workbook, sheet1, sheet2, & Sheet3.
Mostly i worked for data entry in Sheet1 only. And sheet1 has large data till about 15000 rows and column till "R".
Sheet2 and Sheet3 has only formula to get data from Sheet1.

So, all over the data entry speed is now getting low and lag in Sheet1.
If i select calculation mode manual from Formulas menu in excel, then my speed is too much faster.

So, i want that sheet1 is automatic calculation is always ON mode.
Sheet2 & 3 calculation ON only when i tab to Sheet2 or Sheet3, and when i back to Sheet1 then stop calculation in Sheet2 &3.


Have any idea of VBA code, then please give me VBA code,

I have already another VBA code in my worksheet in Sheet1.
which i shows you below.


VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'   Code goes in the Worksheet specific module
    Dim rng As Range
    '   Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")
        Set rng = Target.Parent.Range("b:b,f:f,m:m")
        '   Only look at single cell changes
            If Target.Count > 1 Then Exit Sub
        '   Only look at that range
            If Intersect(Target, rng) Is Nothing Then Exit Sub
        '   Action if Condition(s) are met (do your thing here...)
            If Target.Value = "**" Then Target.Value = Format(Date, "mm/dd/yyyy")
            
    End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
The information in the link might help.

In your workksheet_change event, put in the commands to calculate the sheets you want.

Also if you put in
VBA Code:
Application.ScreenUpdating = False
at the beginning of the code and
VBA Code:
Application.ScreenUpdating = True
at the end

When you are working with WorkSheet_Change events, it you should turn off events before the code makes any changes to the sheet. Otherwise it will be called again, by the change it made.

So you should have at the beginning and end;
VBA Code:
Application.EnableEvents = False
VBA Code:
Application.EnableEvents = True
 
Upvote 0
Duplicate Calculation option VBA code

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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