Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I test for the first character


OK, now I need to make this a little more complex. Instead of jus
comparing against One value: *Range("D18").Value = 1 * I would like t
use Range("D18").Value = 1 or 2 or 3.

Is that possible? How Would that be written?

If Target.Address = "$D$22" Then
If Range("D18").Value = 1 Then
If Mid((Range("D22")), 1, 1) = "A" Then
Checktool.Show
End If
End If
End I

--
Kevla
-----------------------------------------------------------------------
Kevlar's Profile: http://www.excelforum.com/member.php...nfo&userid=723
View this thread: http://www.excelforum.com/showthread.php?threadid=26522

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I test for the first character

If it will only be an integer value then:

If range("D18") =1 and range("D18")<=3 then

or if it can be any value and you want specifically 1, 2 or 3

If range("D18") = 1 or _
range("D18") = 2 or _
range("D18") = 3 then

--
Regards,
Tom Ogilvy

"Kevlar" wrote in message
...

OK, now I need to make this a little more complex. Instead of just
comparing against One value: *Range("D18").Value = 1 * I would like to
use Range("D18").Value = 1 or 2 or 3.

Is that possible? How Would that be written?

If Target.Address = "$D$22" Then
If Range("D18").Value = 1 Then
If Mid((Range("D22")), 1, 1) = "A" Then
Checktool.Show
End If
End If
End If


--
Kevlar
------------------------------------------------------------------------
Kevlar's Profile:

http://www.excelforum.com/member.php...fo&userid=7231
View this thread: http://www.excelforum.com/showthread...hreadid=265222



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test left character is a number? nastech Excel Discussion (Misc queries) 7 October 5th 15 06:05 PM
Test for Single Character That is in an Array scallyte Excel Worksheet Functions 2 November 11th 04 04:47 PM
How do I test for the first character Kevlar Excel Programming 3 October 2nd 04 01:31 AM
How do I test for the first character Kevlar[_3_] Excel Programming 1 October 1st 04 12:01 AM
How do I test for the first character Kevlar[_2_] Excel Programming 0 September 30th 04 09:33 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"