Link to home
Start Free TrialLog in
Avatar of Bright01
Bright01Flag for United States of America

asked on

Problem with the Integration of Macro for Demo Currency Program

EE Pros,

I have a fairly complex macro that Gowflow has produced for me that works until I added one thing.  On the Demos WS, I provided the ability to select one of three conditions (Conservative, Standard or Aggressive) which then results in a specific value being selected.  When you do this, I get 1 error (Script out of range) that I cannot troubleshoot.  Can you help?

The code stops in the Demo WS at;

Sheets(ws).Range(Rng).Value = Intersect(cel.EntireRow, dc.EntireColumn).Value

Try it out by changing the Demo to one of the options.

Thank you in advance,

b.
Problem-with-the-DEMO-of-Currenc.xlsm
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

yes you got this error but who wrote this code and what is it supposed to do ? can't fix a code if  I don't know what you want
gowflow
Avatar of Bright01

ASKER

Well the demo selection code I got from another WB I created some time ago.  

You will recall that the code you gave me provided Currency conversion based on a selected Currency on the "Customer-Input" Tab.  That worked perfectly.  On the Demo Tab however, I simply added a small piece of code that, in addition to the existing conversion, allows you to select, from a table in the Demos Tab, a "Conservative, Standard or Aggressive value and it simply places that value in the cell that you had referenced in the code you sent me.  From there I thought it would simply convert it and hand it back like was built into your original code.

Then I got the error.
Well I fixed it and this is what I found:

1) In the Column D form Demo you inadverttantly put
=Customer - Inputs!C9

NOTE the space before and after the hyphen where in fact your sheet name is
Customer-Inputs
So I simply removed the spaces for all 3 items and this one solved a part.

2) The second part is that you loop on all cells in the range D8 to D91 where in fact you should loop on all values that are in that range as when you hit a blank cell you would have got an other error on these 2 lines
ws = Mid(cel, 2, InStr(cel, "!") - 2)
Rng = Right(cel, Len(cel) - InStr(cel, "!"))


and this was fixed by replacing this line
For Each cel In Range("d8:d91")

by this
For Each cel In Range("d8:d91").SpecialCells(xlCellTypeConstants)

Try this version
gowflow
Problem-with-the-DEMO-of-Currenc.xlsm
Got it.  

But now the update in Col. I on the Currency Table doesn't happen.  Try it out and look at the new Conversion value.

b
FOR SURE IT IS NOT GOING TO WORK !!!!

grrrrrrrr


If you are disorganized that is what happens !!!

2 questions back I gave you a solution, but seemed you used the wrong version of UpdateCurrency in this and the past question which is the reason for this problem.

Here it is I kept the version that you attached and renamed it to UpdateCurrency_OLD and put the one I had given you 2 questions back.

Check this file and make sure you always use the latest version of a macro
CHEERS !!!
:)

gowflow
Problem-with-the-DEMO-of-Currenc.xlsm
Gowflow,

Sorry for any confusion here. This works except:

Change the selection in D3 on Demos and you will see what I'm talking about.  Everything updates except it doesn't put the new value in Currency J10.  (Whenever a new value is added to H:H (Currency), it should pick it up as a "convert" value in "I".  

Does that make sense?

Thank you,

b.
Really I don't know what your talking about.

First in file Currency you mention cell J10 it is an empty cell that have nothing there and you have reduced the column J to very small so I don't understand.

Then you say whenever a new value is added to H:H it should pick up a convert in value I and it does.

I am afraid that maybe you are using a different version ???
Pls try this one I changed the name to make sure no confusion.
gowflow
Problem-DEMO-of-Currenc-V02.xlsm
Gowflow,

Thank you for the follow up!  I just took your latest copy.  Here's what I need you to try to do. Go to the Demos tab, add 3 values in Row 11 (as I am adding additional numbers).  You will see by adding the values, it doesn't trigger an update to the conversion value.

That's the problem.  Hope it's a simple change to update the macro to include the ability to update (it can be either automatic or manual).

B.
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A++++!!!  Now it is working with your coaching.....  I went line item by item until I found the flaw in my code.  It was in the module where you rewrote the code and put "OLD" in the Sub. I was using the OLD sub!  So, I put your code in and it works very well now.  Still integrating on this one so I may have another question soon.....but great work!

Are you located in the U.S. or abroad?

B.
Btw sorry I kept the old which create the confusion DELETE THE OLD with no fear !!!

your welcome anytime. Pls post a link to the new question you may need help with.
Rgds/gowflow
I am very sorry.... I did not give you the right design on the "reference" cells part of this Macro.

Here is the new post:  

https://www.experts-exchange.com/questions/28343980/New-Problem-with-Currency-Conversion-and-Placement.html