I have a great WB and set of Macros that Gowflow has created for me and now I'm scaling it.
I have one change so far as I integrate his work into my master WB; I need a column of cells ("I" in Currency) to recognize the value and any changes, that are created by a formula within the cell it is converting ("H" in Currency which is linked via a formula to another cell in another WS. Right now, I must make the change in the cell itself or put the curser at the end of the formula and click to get it to make the change.; I need to make the change in the source cell in "Demos", that should then automatically update the conversion amount.
Whereas the Code that I posted in the last solution that would take care of changes in Col H to reflect on Col I is for this same Currency worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)If Not Intersect(Target, Columns(8)) Is Nothing Or Not Intersect(Target, Columns(7)) Is Nothing Then UpdateCurrency TargetEnd IfEnd Sub
Try replacing the actual code by this last one in sheet Worksheet_change event of sheet Currency and see if it solve your issue.
gowflow
Bright01
ASKER
Gowflow, Greetings! Just put in your change but that's not the issue. Let me do a better job explaining.
If you open the model I sent, you will see a new tab called "Demos". Go to I7 or I8 and change the Amount. You will see it did get reflected in the Currency Tab. HOWEVER, it will not update the conversion automatically unless you put your cursor in the cell with the new data (In Currency) and hit "return".....then it updates. What I'm attempting to have it do is automatically update from the Demo Tab when the cells are changed there, and return the new currency value (and format) to the Demo Tab in the corresponding Cells Column J.
Gowflow! This works very well for what I need! Although I did say I wanted it (the currency reflected in the "Demos" tab where the formula returned the value, I don't have to have it because you have already allowed me to "reference" a cell in the "Currency" Tab and the Demos tab will be hidden anyway.
Much thanks...... you love a good challenge. Unique talent!
B.
Bright01
ASKER
Can you comment on the specific line(s) you changed so I can simply refine those lines or is it more complicated and I should simply replace a section?
B.
gowflow
no problem here is the new code beside the one I already included as per my last comment. So these are the codes that were not identical in the workbook you posted.
Private Sub Worksheet_Change(ByVal Target As Range)If Not Intersect(Target, Columns(8)) Is Nothing Or Not Intersect(Target, Columns(7)) Is Nothing Then UpdateCurrency TargetEnd IfEnd Sub
I included this in the code of worksheet Currency. This is triggered each and every time any formula need recalculation and this is when we need to refresh the cacluation of currency module.
Private Sub Worksheet_Calculate()Dim Target As RangeSet Target = ActiveCellUpdateCurrency TargetEnd Sub
We tell it to simply affect the current cell (which is Demo something or any other cell and this does not matter) but what is important is that it runs the UpdateCurrency routine and that is what we are after so it simulate as if you go on the currency tab and change manually something in the cells that affect this routine.
Now as regards to the formatting I can include a code in the vba that would give you the formatting in the cell that you want in Demo but this does not mean that if you copy the formula to any cell that you will get the formatting as well. So your choice do you want me to incorporate this in the code ?
I almost have it. What is the specific code that updates the converted currency cells in "Demos"? That's the only thing that isn't working in my production code.
TY,
B.
gowflow
Well no code in Demos !!! that's the trick.
You should make sure to have the above code put in sheet Currency only. The most important part is the Calculate Event it is the one that triggers the update. This way if you put any reference to any other sheet in any sheet it will give you the result updated provided you have the routine set above in the calculate event. I put it again here.
Make sure you have the following cod in Currency sheet
Private Sub Worksheet_Calculate()Dim Target As RangeSet Target = ActiveCellUpdateCurrency TargetEnd Sub
gowflow