Microsoft Office Forums enter a constant based on entered number

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2014, 04:53 AM
So New2 This So New2 This is offline enter a constant based on entered number Windows XP enter a constant based on entered number Office 2007
Novice
enter a constant based on entered number
 
Join Date: May 2013
Location: Cleveland,OH
Posts: 3
So New2 This is on a distinguished road
Default enter a constant based on entered number


I need help in figuring out how to enter a constant based on a value entered into a word table. For instance if the table cell has 98, I need to add 3.3 , if 97.5 I need to add 3.0. The last value is 20 with a constant of 0.47
Reply With Quote
  #2  
Old 10-17-2014, 05:29 AM
gmaxey gmaxey is online now enter a constant based on entered number Windows 7 32bit enter a constant based on entered number Office 2010 (Version 14.0)
Word MVP 2003-2009
 
Join Date: May 2010
Location: Marble, NC
Posts: 918
gmaxey will become famous soon enoughgmaxey will become famous soon enough
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Select Case CDbl(Left(ActiveDocument.Tables(1).Cell(1, 1).Range.Text, Len(ActiveDocument.Tables(1).Cell(1, 1).Range.Text) - 2))
  Case 98
    MsgBox 100 / 3.3
  Case 97.5
    MsgBox 100 / 3
  Case 20
    MsgBox 100 / 0.47
  Case Else
    MsgBox 100
End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a table with a number of line depending a number entered by user Cellendhyll Word Tables 3 07-10-2014 05:49 AM
Constant Enter Network Password popups rec Windows 0 09-13-2013 12:54 AM
enter a constant based on entered number Contact details entered based on multiple drop down selections ntropey87 Word VBA 4 04-20-2013 11:19 AM
Programming based on an enter key event edayers315 Word VBA 0 06-11-2010 09:57 AM
enter a constant based on entered number Making sure the correct number of characters are entered. leroytrolley Excel 1 07-25-2008 06:38 AM


All times are GMT -7. The time now is 06:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft