Excel/macro Formula Problem!

N

nic17

Help!!

I have created a macro and i am trying to pull all the rows from m
data source where in one field 'incomp' the data does not equal blank
I know its simple, but i cannot figure it out!

I have tried <>" " and i have tried !=" " but neither work!

Can anyone help?
 
B

BrianB

In your example you have put a space between the 2 quotation marks whe
they should have nothing between. i.e. an "empty string"
 
N

nic17

Thanks for your help,

I have tried both of these suggestions, but neither work! I've als
tried below:

<>""
<>" "
< >""
< >" "
!=""
!=" "

It's such a simple task, so why does this not work??:confused
 
C

Chip Pearson

Post the code that you are using. Code like the following should
work:

If Range("A1").Value <> "" Then
' A1 has something in it
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
N

nic17

Below is the macro that I have set up:

Application.ScreenUpdating = False
Sheets("MTHDATA").Visible = True
Sheets("Criteria2").Visible = True
Sheets("Criteria2").Select

Range("datainput").AdvancedFilter Action:=xlFilterCopy
CriteriaRange _
:=Range("critrep1"), CopyToRange:=Range("report1")
Unique:=True

Sheets("Macro").Select
Range("C5").Select
Application.ScreenUpdating = True
End Sub

The criteria this is reading from is:

Report1 Incomp
< >"0"

It should then dump this into 'report 1'.

This has worked for all the other reports
 
Top