Bright01
asked on
Updating Currency
EE Pros,
Macroshadow worked with me on a Currency Conversion Program that I need to redo. Attached is a WB with 3 WSs. I'm looking for a macro that will appear on the first WS and update the MSN Currency chart (WS - Currency) and then place the correct Currency that is selected into two cells located on the other two WSs.
That's it!
Thank you in advance.
b.
Macros-and-formulas-to-support-C.xlsm
Macroshadow worked with me on a Currency Conversion Program that I need to redo. Attached is a WB with 3 WSs. I'm looking for a macro that will appear on the first WS and update the MSN Currency chart (WS - Currency) and then place the correct Currency that is selected into two cells located on the other two WSs.
That's it!
Thank you in advance.
b.
Macros-and-formulas-to-support-C.xlsm
ASKER
The Update Table works! The provisioning of the value selected doesn't work yet. Take a look.....
B.
Currency-Update-and-Display.xlsm
B.
Currency-Update-and-Display.xlsm
Delete one of the apostrophes from each of G4 and G5. You will be left with two each. One hidden and one displayed.
ASKER
Now I'm getting a -0- instead of the selected currency. Take a look.
Currency-Update-and-Display.xlsm
Currency-Update-and-Display.xlsm
That formula was supposed to pick up values from the yellow cells on the other two sheets which are presently empty. If you want the values picked from the pound column then change those formulas to
=INDEX(J4:R4,0,MATCH('Cust omer-Input s'!$F$2,Cu rrency!$J$ 3:$R$3))
=INDEX(J5:R5,0,MATCH('Cust omer-Input s'!$F$2,Cu rrency!$J$ 3:$R$3))
And also make sure that the spelling in Customer!F2 "exactly" maches one of the column headers on Currency sheet.
=INDEX(J4:R4,0,MATCH('Cust
=INDEX(J5:R5,0,MATCH('Cust
And also make sure that the spelling in Customer!F2 "exactly" maches one of the column headers on Currency sheet.
ASKER
OK... I got it. Now I see what is the problem. The right formula for the Currency Value is:
=INDEX(J4:R4,0,MATCH('Cust omer-Input s'!$F$2,Cu rrency!$J$ 3:$R$3))
BUT;
What is suppose to happen is once the formula provides the value (above), then the macro should place this value into the Cell that is Cell Referenced (in column G). That's the part that's missing. I should have been more clear on what I was looking for.
Thank you,
B.
=INDEX(J4:R4,0,MATCH('Cust
BUT;
What is suppose to happen is once the formula provides the value (above), then the macro should place this value into the Cell that is Cell Referenced (in column G). That's the part that's missing. I should have been more clear on what I was looking for.
Thank you,
B.
Ok try this
Sub CurrencyUpdate()
Sheets("Currency").QueryTa bles(1).Re fresh
With Sheets("Currency").Range(" G4")
Sheets(Replace(Split(.Valu e, "!")(0), "'", "")).Range(Split(.Value, "!")(1)).Value = .Offset(, 2).Value
End With
With Sheets("Currency").Range(" G5")
Sheets(Replace(Split(.Valu e, "!")(0), "'", "")).Range(Split(.Value, "!")(1)).Value = .Offset(, 2).Value
End With
End Sub
Sub CurrencyUpdate()
Sheets("Currency").QueryTa
With Sheets("Currency").Range("
Sheets(Replace(Split(.Valu
End With
With Sheets("Currency").Range("
Sheets(Replace(Split(.Valu
End With
End Sub
ASKER
Perfect! Works well. Only one last question; as I scale this, I'm going to have to put in multiple lines of this...... ( I have 50 lines!).
With Sheets("Currency").Range(" G4")
Sheets(Replace(Split(.Valu e, "!")(0), "'", "")).Range(Split(.Value, "!")(1)).Value = .Offset(, 2).Value
End With
With Sheets("Currency").Range(" G5")
Sheets(Replace(Split(.Valu e, "!")(0), "'", "")).Range(Split(.Value, "!")(1)).Value = .Offset(, 2).Value
Is there a way to reference the range without replicating the lines over and over?
B.
With Sheets("Currency").Range("
Sheets(Replace(Split(.Valu
End With
With Sheets("Currency").Range("
Sheets(Replace(Split(.Valu
Is there a way to reference the range without replicating the lines over and over?
B.
Try this. I have not tested it.
For Each cel In Sheets("Currency").Range(" G4:G5")
Sheets(Replace(Split(cel.V alue, "!")(0), "'", "")).Range(Split(cel.Value , "!")(1)).Value = cel.Offset(, 2).Value
Next cel
For Each cel In Sheets("Currency").Range("
Sheets(Replace(Split(cel.V
Next cel
ASKER
I get an error that "cel" is not defined.
B.
B.
Then define it as a range
ASKER
So simply define "cel" as a Range Name? I'm confused....sorry. Do I simply list the range as G:G so it will accommodate all of the additional lines?
B.
B.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That got it! Thank you.
Have a happy thanksgiving......
B.
Have a happy thanksgiving......
B.
Sheets("Currency").QueryTa
Correcting G4, G5 to
''Customer-Inputs'!C9
''Price Quote'!F20
and inserting these formulas in I4, I5
=INDIRECT(G4)
=INDIRECT(G5)
will pick values from the other sheets
Using this formula in I4, I5
will give the values in the selected currency
=INDIRECT(G4)*INDEX(J4:R4,
=INDIRECT(G5)*INDEX(J5:R5,