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: 470
Default Verifying input

I have a workbook that contains two sheets (Items, Order). The Order sheet
is what the user uses to input data to place an order, ie item number and
qty. The Items sheet list the item number and item description. I am using
a macro to control cursor movement (left - right) for entering item number
and qty before advancing to the next row for the next item.

I am trying to figure out how to check the item number entered by user
against the item numbers in the list on the Items sheet (A2:A300), to make
sure that the item number entered is valid.

Below is the code used to control cursor movement. It is within this code
that I need to validate the item number and NOT advance until a valid number
is entered. I can figure out how to display a message box to notify user of
incorrect number. Just need the code. NOTE: Prior to entering this area of
code, Cell "A13" has already been selected via RANGE ("A13").Select.

If Not Intersect(Target, Range("A13:B90")) Is Nothing Then
If Target.Column = 1 Then
Target.Offset(, 1).Select 'advance to col B for qty
Else
Target.Offset(1, -1).Select 'advance to next row, col A for item
number
End If
End If

Also, when checking the list in the Items sheet, can A:A be used instead of
A2:A300 in the event new items are added in order to not have to go back and
edit the range to search in the macro?

Thanks,
Les
 
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
Look up a value from a row after verifying two other values Paul W Excel Worksheet Functions 11 September 1st 08 08:59 PM
Verifying value of a cell El Criollo Excel Discussion (Misc queries) 7 December 12th 06 10:21 AM
Verifying Printer with Excel VBA Craig[_21_] Excel Programming 3 September 9th 05 09:14 AM
Verifying Dates gilbert Excel Worksheet Functions 1 September 8th 05 03:22 AM
verifying date MacroMan Excel Programming 0 July 30th 03 10:38 PM


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