ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Code to calc (https://www.excelbanter.com/excel-discussion-misc-queries/109754-code-calc.html)

Marcelo

Code to calc
 
hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change, could you
help?

regards from Brazil

Marcelo


Dave F

Code to calc
 
F9 will force Excel to recalculate the workbook.

Dave
--
Brevity is the soul of wit.


"Marcelo" wrote:

hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change, could you
help?

regards from Brazil

Marcelo


Marcelo

Code to calc
 
Dave thanks for your help,

I am talking about a ruge wb and it will be used by tge final users, I have
been forced the manual calculation, what I'm looking for is a code that when
the people selected a customer in a drop down box the refers cell will change
and excel calc it.

--
regards from Brazil
Marcelo



"Dave F" escreveu:

F9 will force Excel to recalculate the workbook.

Dave
--
Brevity is the soul of wit.


"Marcelo" wrote:

hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change, could you
help?

regards from Brazil

Marcelo


Dave Peterson

Code to calc
 
Maybe one of these (depending on what version of excel you're using--and what
you want to do):

Application.Calculate
Application.CalculateFull
application.CalculateFullRebuild

Look at VBA's help for details.

Marcelo wrote:

Dave thanks for your help,

I am talking about a ruge wb and it will be used by tge final users, I have
been forced the manual calculation, what I'm looking for is a code that when
the people selected a customer in a drop down box the refers cell will change
and excel calc it.

--
regards from Brazil
Marcelo

"Dave F" escreveu:

F9 will force Excel to recalculate the workbook.

Dave
--
Brevity is the soul of wit.


"Marcelo" wrote:

hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change, could you
help?

regards from Brazil

Marcelo


--

Dave Peterson

Bob Phillips

Code to calc
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B1:B40"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Calculate
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub



'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Marcelo" wrote in message
...
Dave thanks for your help,

I am talking about a ruge wb and it will be used by tge final users, I

have
been forced the manual calculation, what I'm looking for is a code that

when
the people selected a customer in a drop down box the refers cell will

change
and excel calc it.

--
regards from Brazil
Marcelo



"Dave F" escreveu:

F9 will force Excel to recalculate the workbook.

Dave
--
Brevity is the soul of wit.


"Marcelo" wrote:

hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change,

could you
help?

regards from Brazil

Marcelo




Marcelo

Code to calc
 
Hi Bob,

Perfect as usual ;-)


--
regards from Brazil
Marcelo



"Bob Phillips" escreveu:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "B1:B40"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Calculate
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub



'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Marcelo" wrote in message
...
Dave thanks for your help,

I am talking about a ruge wb and it will be used by tge final users, I

have
been forced the manual calculation, what I'm looking for is a code that

when
the people selected a customer in a drop down box the refers cell will

change
and excel calc it.

--
regards from Brazil
Marcelo



"Dave F" escreveu:

F9 will force Excel to recalculate the workbook.

Dave
--
Brevity is the soul of wit.


"Marcelo" wrote:

hi guys,

sorry for the stupid question but...

I would like a code to calculate the wb when a cell value change,

could you
help?

regards from Brazil

Marcelo






All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com