Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Currency exchange macro help

Nov 22, 2010 1:23AM PST

I'm trying to create a macro that will convert selected cells from CAD to USD with the click of a button. Is this possible? I have no experience with VBA, but I think this is what I need to get this done... Any ideas?

Discussion is locked

- Collapse -
Do you mean in Excel?
Nov 22, 2010 5:11AM PST

If so, it shouldn't be too difficult, but it would be far easier just to set up a few cells in the spreadsheet manually to do the conversion.

Current conversion rate is 0.9826. 1 CAD = $0.9826 but that will change daily, so the first variable will be the current exchange rate.

Set up B1 with 0.9826

Then if cell A10 has CAD, then cell B10 has the formula, =A10*$B$1

The $B$1 tells Excel that, when you drag B10 down to cells below it, A10 will change to A11, A12, etc, but B1 remains the same.

Does that help?

Mark

- Collapse -
Re: In Excel
Nov 22, 2010 10:09PM PST

Thanks Mark, I have that much figured out, but my situation is a little unique.

I need to convert multiple columns in a spreadsheet after the info is all entered at CAD.

I have a separate sheet pulling data from the original, so I want the user to be able to enter all of their info in CAD, then click a button with a macro assigned to it, that would convert all the cells that I have defined, into USD...

- Collapse -
Re: CAD to USD
Nov 23, 2010 5:16AM PST

Yep, that needs a macro. As Mark said, not too difficult. But for some reason, it takes some time to become familiar with the Excel 'methods'.

Google something like EXCEL VBA TUTORIAL to get started.

Kees