View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Philip J Smith Philip J Smith is offline
external usenet poster
 
Posts: 80
Default How to recalculate a worksheet when a selection is made

Hi Norman.

The selection of an element from a valid list in cell B2 causes the content
to change in another cell. I know that the code is not working because that
other cell does not change.

Thanks for your updated response and sorry for being thick but what does

"in the immediate window" mean?

Do I insert this into the code in the macro in "This Workbook" module like
the following,

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'This macro recalculates the worksheet whenever a
'selection is made from the dropdown list.
Application.EnableEvents = True
If Intersect(Me.Range("B2"), Target) Is Nothing Then Exit Sub
Me.Calculate
End Sub


or should it go somewhere else?



"Norman Jones" wrote:

Hi Philip,

Your code works for me in that the selection of cell B2 triggers the
recalculation of the sheet.


If, in these circumstances, the recalculation is not being triggered, it is
possible that Events have been turned off.

To eliminate this possibility, in the immediate window type:

Application.EnableEvents = True

and hit Enter.


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Philip,

Your code works for me in that the selection of cell B2 triggers the
recalculation of the sheet.

However, how is this related to the use of Data Validation in cell C2?


---
Regards,
Norman