View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Stop Macro if there is no data

I don't know.

I put that little portion into a test sub:

Option Explicit
Sub testme()

Dim LastRow As Long
LastRow = 13

With ActiveSheet
With .Range("D2:D" & LastRow)
.FormulaR1C1 _
= "=IF(OR(ISNUMBER(SEARCH({""fee"",""inter""},RC[-1])))," _
& """F"",IF(OR(ISNUMBER(SEARCH({""transf""," _
& """dire ctpay"",""xf""},RC[-1]))),""T"",""O""))"
'.Value = .Value
End With
End With

End Sub

(Notice the ".value = .value" is commented out.)

And the formula worked nicely.

What's lastrow equal to when you get to that line?


STEVEB wrote:

Thanks so much for your help Dave, I really appreciate it! It seems
like we are very close!!!

I agree, your code is a lot less confusing. At this point the code is
able to post the information from the "download" sheet to the "sorted"
sheet. After that I recieve the following error:

Run time error 1004 - Application-defined or object defined error.

At this point:

FormulaR1C1 _
= "=IF(OR(ISNUMBER(SEARCH({""fee"",""inter""},RC [-1])))," _
& """F"",IF(OR(ISNUMBER(SEARCH({""transf""," _
& """dire ctpay"",""xf""},RC[-1]))),""T"",""O""))"

What I am missing? Thanks so much for your help!!

--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=509401


--

Dave Peterson