Hi,
I have a bit of code in sheet two of my document that requires user input to produce output. However I have the document set up in a vway that requires the actual input to be placed in a vell in sheet one, and the cell in sheet two is just "=cell in sheet one".
This causes the input cell in sheet two to change but the output cell does not produce the new answer.
Anyone know why?
Thanks in advance!
Last edited by heidenman; 07-31-2009 at 03:05 PM.
Hallo,
does the recalculation (F9) help? The original file would be helpful to understand you. Can you attach it?
Regards
Petr
Sheet 2 E2 changes on the basis of what is given in E1. However only when input is given manually it seems, and this is my problem.
I need Sheet 2 E1 to pick up input from sheet 1 F13 and then E2 to change.
This in turn gives the ouptut back to a calculation in sheet 1 F14.
Thanks!
When the value changes on Ark2 it is changing as the result of a 'Calculate' not a 'Change', so you would need to use the Worksheet_Calculate event of Ark2, and adapt your code to fit it, as per below. This goes into the Ark2 sheet code:
Incidently, E1 on the Ark2 sheet could have this forumla:Code:Private Sub Worksheet_Calculate() Const IN_CELL As String = "E1" Const OUT_CELL As String = "E2" With Me ' the sheet that called the 'Calculate' event .AutoFilterMode = False ' Remove any old filter .Cells(1, 1).AutoFilter field:=1, Criteria1:=.Range(IN_CELL).Value ' filter on the INPUT cell Application.EnableEvents = False ' Set the output cell to the minimum price .Range(OUT_CELL).Value = WorksheetFunction.Min(.AutoFilter.Range.Cells.SpecialCells(xlCellTypeVisible)) Application.EnableEvents = True .AutoFilterMode = False ' Remove the filter again End With End Sub
Then you wouldn't need the 'helper' cell in column G of Ark1 (and therefore wouldn't need to hide that columnCode:=CONCATENATE(Ark1!E13," ",Ark1!F13))
Last edited by Phil_V; 07-31-2009 at 06:45 AM. Reason: E1 formula change
If you find the response helpful please click the scales in the blue bar above and rate it
If you don't like the response, don't bother with the scales, they are not for you
Works perfectly...
I am bowing in awe and respect.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks