View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stuart Luscombe Stuart Luscombe is offline
external usenet poster
 
Posts: 1
Default Stuck on a validation loop

Hi all,

It's been a few years since I've done any kind of VB programming (or any
programming for that matter), but I am trying to automate a reporting
process that I have to do every morning as part of my job.

What I am trying to achieve is to get the contents of a cell on one sheet
of a workbook (after importing data), check it against a cell on another
sheet, repeat the process for another cell but then make sure that the 2
cells that have been found are on the same row.

So at the moment it's something along these lines:

celldate = Worksheets("Sheet1").Cells(currentrow, currentcolumn)
MsgBox (celldate)

founddate = Worksheets("Primes & Outlets").Cells.Find(celldate)
MsgBox (founddate)

If founddate = celldate Then verifieddate = True

And the same goes for checking the 'day' as well.

The only problem being is that whereas there is only 1 01-FEB-05, there
are many THURSDAY(s). So what I want to do is check to make sure
something like founddate.Row = foundday.Row.

Having not written any code in such a long time I'm having difficulty
getting the syntax right for what I need to do...which is:

if foundday.Row < founddate.Row then
foundday = .FindNext(day)
until
foundday.Row = founddate.Row
EndIf

....or something like that, like I said, I've not done this for years.

Hope one of you can help
--
Stu