Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2020, 06:03 PM
Stephen Ray Stephen Ray is offline How To Test For Numeric Windows 10 How To Test For Numeric Office 2016
Advanced Beginner
How To Test For Numeric
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default How To Test For Numeric

This will be easy for you guys, but I can't figure it out.
I want to test the first word on the first line of my Word Document to see if it is Numeric.
Then if it is Numeric, I want to run some code.
Else
Run some other code.


I know I will have to use Range for the first paragraph and the first word.


I have looked for examples for hours but nothing seems to work.
I know that isnumeric will be used.
Thanks
Reply With Quote
  #2  
Old 09-22-2020, 06:51 PM
Guessed's Avatar
Guessed Guessed is online now How To Test For Numeric Windows 10 How To Test For Numeric Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

try
Code:
  If IsNumeric(ActiveDocument.Words(1).Text) Then
    Debug.Print "A hit"
  End If
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 09-23-2020, 03:54 PM
Stephen Ray Stephen Ray is offline How To Test For Numeric Windows 10 How To Test For Numeric Office 2016
Advanced Beginner
How To Test For Numeric
 
Join Date: Sep 2018
Location: Kansas
Posts: 34
Stephen Ray is on a distinguished road
Default

Guessed, Thank you very much. It was even more simple than I thought. I was trying to make a couple of Dim statements and complicate things.
Case closed.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Test For Numeric Test, just a test Thomasordef Office 0 07-25-2019 10:43 AM
Student's t-test (T.TEST): how to get p value? seanspotatobusiness Excel 1 07-20-2018 05:46 AM
How To Test For Numeric Numeric Values jrt Word VBA 2 11-09-2014 01:28 PM
How To Test For Numeric Use the dot key on the numeric keypad YooNaa Kim Word 2 09-09-2013 08:25 AM
test Cheekychino PowerPoint 1 04-08-2013 09:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:13 AM.


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