We help IT Professionals succeed at work.

Hoist the colors! We’ve added location flags to usernames sitewide, so it's easier to connect with the global community on EE. View My Profile

x

Currency Conversion Integration Fix

Bright01
Bright01 asked
on
317 Views
Last Modified: 2014-01-18
EE Pros,

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.

I have attached the sample for you.

Thank you in advance.

B
Copy-of-Currency-Update-and-Disp.xlsm
Comment
Watch Question

gowflowPartner
CERTIFIED EXPERT

Commented:
Sorry but I don't understand your request at all could you explain it in a better way ?
gowflow
gowflowPartner
CERTIFIED EXPERT

Commented:
Opps !!!! I just noticed something (I hope you haven't used an old version of the macro when you transferred the code to your production WB as)

The code in sheet Currency that I found in the attached workbook is:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns(8)) Is Nothing Then
    UpdateCurrency Target
End If
End Sub

Open in new window


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 Target
End If
End Sub

Open in new window


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

Author

Commented:
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.

Hope that helps.

B.
Partner
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.

Author

Commented:
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.
gowflowPartner
CERTIFIED EXPERT

Commented:
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 Target
End If
End Sub

Open in new window


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 Range
Set Target = ActiveCell
UpdateCurrency Target

End Sub

Open in new window


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 ?

gowflow

Author

Commented:
Gowflow,

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.
gowflowPartner
CERTIFIED EXPERT

Commented:
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 Range
Set Target = ActiveCell
UpdateCurrency Target

End Sub

Open in new window


gowflow
gowflowPartner
CERTIFIED EXPERT

Commented:
Did it work for you ?
gowflow

Author

Commented:
Gowflow,  been working on it all morning!  Have one error due to me adding a selection process in the Demos WS.

Here is the new question:

https://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28342116.html

Thank you.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.