LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Check i a value is in a Range

Hi,

I have a worksheet on which I have some week numbers entered in Column A.
Within a Sub I use an InputBox to get the user to type in a week number.
What I would like to do is to check whether the week number typed in by the
user is in Column A. If it isn't I would like to ask the user to enter a
valid week number and show the InputBox again. If the week number entered is
in Column A, then I read a value from a Named Range and put in in Column B
beside the week number entered

What I did was a simple Sub but I have no validation so it's a bit poor :

Weeknum = InputBox("Please enter your week number")

Do
i = i + 1

Loop Until Range("A" & i).Value = Weeknum


Range("B" & i).Value = MyStock
Range("B" & i).NumberFormat = "#,##0.0000"

I tried writing something with Cells.Find but it didn't work I got a type
mismatch error.
Can someone help me with this ?

Thanks in advance,

Armelle Aaserød



 
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 no cell is the same within a range Neil Pearce Excel Discussion (Misc queries) 3 October 23rd 08 01:46 PM
can a formula check for a certain value in a range? Lee IT Excel Discussion (Misc queries) 1 April 7th 05 04:31 PM
Check if a range is a sebset of another range Bob Phillips[_6_] Excel Programming 0 May 6th 04 04:12 PM
Check if a range is a sebset of another range Chip Pearson Excel Programming 0 May 6th 04 03:54 PM
check range for certain value Gareth[_3_] Excel Programming 4 November 10th 03 03:08 PM


All times are GMT +1. The time now is 09:00 AM.

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

About Us

"It's about Microsoft Excel"