![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 21
|
How do I write code that looks for NA's in the active range, and if it finds them it stops, however it contines the macro, if no NA/s are present......
any ideas? |
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
Try something like this:
i=1 Do Until Sheet1.Cells(i, 1).Value = "" Or Application.WorksheetFunction.IsNA(Sheet1.Cells(i, 1).Value) = True Sheet2.cells(i,1).value = Sheet1.cells(i,1).value i=i+1 Loop You need : Application.WorksheetFunction.IsNA(cellvalue) worksheet function in VBA module to check if cell value is #NA or not. Regards |
|
|
|
|
|
#3 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
May be this is better to explain:
if Application.WorksheetFunction.IsNA(ActiveCell.Value) = True Then 'Stop running Else 'Continue End if |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|