#1
|
|||
|
|||
Manipulating Data in Cells
Hi All,
It's more than likely that I'm trying to achieve the impossible; but here is my problem. I have a supplier who sends me a Word Document which is a Price List with the products priced in their local currency and I need to convert this into my local currency; sounds simple on the face of it but I have several problems Problems: -
Currently I am sitting down with a calculator and manually editing each cell, a process which takes several hours to complete. I have been scratching my head for a few days now find some easy solution to this and automate the manipulation of the cell holding the prices. I'll include a screen snip so you can see what I'm up against. Any feedback would be cool. |
#2
|
||||
|
||||
You could do the conversions with a macro like:
Code:
Sub ConvCurrency() Application.ScreenUpdating = False Dim Tbl As Table, r As Long, c As Long, xchg As Single, strVal As String xchg = CSng(InputBox("Exchange Rate to Apply?", "ForEx Conversion", "1.00")) If xchg <= 0 Then Exit Sub For Each Tbl In ActiveDocument.Tables With Tbl c = .Columns.Count For r = 1 To .Rows.Count With .Cell(r, c).Range strVal = Split(.Text, vbCr)(0) If IsNumeric(strVal) Then .Text = Format(CSng(strVal) * xchg, ",0.00") Else .Text = "USD" End If End With Next End With Next Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Manipulating 3D objects in Powerpoint 2013 | MScrazy | PowerPoint | 0 | 05-27-2014 02:29 PM |
How to populate cells in Sheet2 with Data Source query using cell data from Sheet1 | bobznkazoo | Excel | 2 | 03-27-2014 11:14 AM |
Manipulating Task data from email. | dvad | Outlook | 0 | 05-10-2011 01:55 PM |
manipulating cross-reference fields | _wim_ | Word | 0 | 12-10-2010 05:52 AM |
Manipulating checkboxes in XML | Ivo | Word | 0 | 12-06-2005 09:04 AM |