Thread: Code to calc
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Marcelo Marcelo is offline
external usenet poster
 
Posts: 1,047
Default 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