Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check to see if variable is duplicate.

I am grabbing var1 from an inputbox.

I want to say if var1 = any of the values entered in cells b4:b32 the
goto Double

I tired

if var1 = range("b4:b32").value then goto double

but didnt work, any suggestions

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Check to see if variable is duplicate.

On Error Resume Next
iPos = Application.Match(var1, Range("B4:B32"), 0)
If iPos 0 Then _
MsgBox "hello"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ianripping " wrote in message
...
I am grabbing var1 from an inputbox.

I want to say if var1 = any of the values entered in cells b4:b32 then
goto Double

I tired

if var1 = range("b4:b32").value then goto double

but didnt work, any suggestions?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check to see if variable is duplicate.

Thanks bo

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check to see if variable is duplicate.

bob, even if that value doesnt appear, it stil reports it as bein
there

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Check to see if variable is duplicate.

Ian,

You must declare iPos as a long to get this to work. If it defaults to
variant, it will always be 0

Dim iPos As Long

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ianripping " wrote in message
...
bob, even if that value doesnt appear, it stil reports it as being
there!


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check to see if variable is duplicate.

ok did that, still doing the sam

--
Message posted from http://www.ExcelForum.com

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
Check if Duplicate with Exceptions mjones Excel Worksheet Functions 6 January 18th 10 12:37 PM
Duplicate check Robzz Excel Worksheet Functions 4 May 5th 09 02:41 PM
check for duplicate numbers Ash Excel Worksheet Functions 13 October 31st 06 10:15 AM
duplicate check rufusf Excel Worksheet Functions 2 August 29th 06 04:30 PM
How can I check for duplicate $'s? MDG Excel Worksheet Functions 0 January 25th 06 10:01 PM


All times are GMT +1. The time now is 12:09 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"