Reply
 
Thread Tools Display Modes
  #1   Report Post  
Simon
 
Posts: n/a
Default Recalculating Prices in a word table

I need to read through a word document (Table)
The table has merged cells for Heading

Part No Description Price
====================
Widgets
A12344 Widget 1 £ 5.99
WA123 Widget 2 £ 6.45

Thinggies
D555 Thinggy 1 £ 12.67
RT6161 Thinngy 2 £ 17.50

I need to produce a Trade Price List
so say I deduct 20% from each value

Can't seem to get the VALUE into a a NUMBER format !!!

Sub Trade()
'
' Calculate Trade Price List
'
Application.ScreenUpdating = False
Dim x As Integer
Dim LastRow As Long 'get used LASTROW
LastRow = ActiveDocument.Tables(1).Rows.Count

For x = 1 To 5 'LastRow
Dim Price As Variant
Dim Trade As Variant
Price = Selection.Tables(1).Rows(x).Cells(3)
Retail = Val(Price) * (1-0.2)
MsgBox (Price & Trade)
Next x

End Sub




  #2   Report Post  
TF
 
Posts: n/a
Default

Use Excel.

--
Terry Farrell - Word MVP
http://word.mvps.org/

"Simon" wrote in message
...
:I need to read through a word document (Table)
: The table has merged cells for Heading
:
: Part No Description Price
: ====================
: Widgets
: A12344 Widget 1 £ 5.99
: WA123 Widget 2 £ 6.45
:
: Thinggies
: D555 Thinggy 1 £ 12.67
: RT6161 Thinngy 2 £ 17.50
:
: I need to produce a Trade Price List
: so say I deduct 20% from each value
:
: Can't seem to get the VALUE into a a NUMBER format !!!
:
: Sub Trade()
: '
: ' Calculate Trade Price List
: '
: Application.ScreenUpdating = False
: Dim x As Integer
: Dim LastRow As Long 'get used LASTROW
: LastRow = ActiveDocument.Tables(1).Rows.Count
:
: For x = 1 To 5 'LastRow
: Dim Price As Variant
: Dim Trade As Variant
: Price = Selection.Tables(1).Rows(x).Cells(3)
: Retail = Val(Price) * (1-0.2)
: MsgBox (Price & Trade)
: Next x
:
: End Sub
:
:
:
:


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The WordPerfect "Reveal Codes" method is so much easier to use. Torden Microsoft Word Help 8 April 19th 10 07:50 PM
Underscore (_) will not always display in RTF files (Word 2002). David A Edge Microsoft Word Help 6 June 14th 05 10:39 AM
is word perfect compatible with office word? Noreen Microsoft Word Help 1 May 11th 05 11:17 PM
creating forms Fluffypink Microsoft Word Help 4 March 9th 05 04:17 PM
letters - ask/fillin Caroline H New Users 2 February 25th 05 08:19 PM


All times are GMT +1. The time now is 08:26 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"