Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Martin
--you can either you Worksheetfunction.ISNA() as suggested by OssieMac or use .Text property of range to check NA() s as below. --You can use the .End(xlToLeft) to determin the last column in that row with any data.This way you can avoid unnecessary loops.. Dim lngCol As Long For lngCol = Cells(2, Columns.Count).End(xlToLeft).Column To 1 Step -1 If Cells(2, lngCol).Text = "#N/A" Then Columns(lngCol).Delete Next If this post helps click Yes --------------- Jacob Skaria "Martin" wrote: Hi I want to check the value of row 2 in each column and if it = "#N/A" then delete the column. I have got this far but it doesn't wuite work. Can anyone help? For iColumn = 1 To 256 If Cells(2, iColumn).Value = "#N/A" Then Columns(iColumn).EntireColumn.Delete Next iColumn Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
check for numeric values in a column | Excel Programming | |||
Loop through column(s) to check values, perform action based on check | Excel Programming | |||
Check if all values in a column is identical | Excel Programming | |||
How to check for duplicate values within a column | Excel Programming | |||
check value in cells against all values in a column | Excel Programming |