Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default macro custom error check

For each matching value I find in column A, I need to check to see whether a
condition is true in another cell in different column but in the same row. I
need to limit the search by the size of the data as opposed to blanks because
there are blanks, so the beginning is necessary.

Range("D10").Select

x = ActiveCell.Row
y = ActiveCell.Column
w = 0

Do While Cells(x, y).Value < ""
x = x + 1
w = w + 1
Loop

Range("A10").Select

x = ActiveCell.Row

Do Until x = w + 10
Cells(x, 1).Select
A = Cells(x, 1).Value
Cells(x, 3).Select
C = Cells(x, 3).Value
If (A = "purchased") And (C = 0) Then
Cells(x, 3).Select
MsgBox "The selected cell SHOULD have a posting reference number."
Exit Sub
Else
x = x + 1
End If

Loop

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
Error Msg 400 - Macro Spell Check Rog Excel Discussion (Misc queries) 2 December 13th 06 07:09 PM
Sum up columns in different sheet with error check zeyneddine Excel Discussion (Misc queries) 13 July 10th 06 01:21 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
How do I correct a cyclic redundancy check error Jeff Excel Discussion (Misc queries) 1 March 25th 05 06:09 PM
data error - cyclic redundancy check Scaper Excel Discussion (Misc queries) 1 December 22nd 04 08:00 PM


All times are GMT +1. The time now is 03:46 PM.

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"