Macros Help

S

S.J. Powell

Need some assistance! I have a list of data with numerous columns o
dollar amounts. The values in the data are both in US dollars an
Canadian dollars... the values in canadian dollars are labled "CDN".
want to be able to automatically convert those labled "CDN" to U
dollar amounts via a macro. I tried several times and I'
stuck:confused: Can anyone provide their expetise?

Thank
 
B

Bob Phillips

Here's a macro to do it. It assumes that the amount is in the cell to the
right of CDN. Select all of the cells and run the macro

Sub Convert()
Dim rate As Double
Dim cell As Range

rate = InputBox("Supply exchange rate")
For Each cell In Selection
If cell.Value = "CDN" Then
cell.Offset(0, 1).Value = cell.Offset(0, 1).Value / rate
End If
Next cell

End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top