View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MoonWeazel[_10_] MoonWeazel[_10_] is offline
external usenet poster
 
Posts: 1
Default runtime error 13 - unlucky for some!


afternoon!

this has been bugging me for ages!

am not excellent in vba so please be nice!!

i have a spreadsheet of about 1500 lines and would like to (using
macro) strip out all the records i don't need based a value in one o
the columns.

for example:

column b holds the name of the programme and i only want projects wit
a programme name of either zmxxxx or zmyyyy. the macro i am tryin
(and failing)to write would look at the value of b1, evaluate it an
delete it if it didn't match either zmxxxx or zmyyyy.

the code:

Sub tidy_up()

Const workstream1 As String = "zmxxx"
Const workstream2 As String = "myyyy

Dim project As String

project = activecell

If CStr(project) < CStr(workstream1) Or CStr(workstream2) Then

activecell.EntireRow.Delete

Else

End If

End Sub

i keep getting run time error 13 appear. i can't see where the proble
is as everything matches (as far as my very untrained eye can see!)

please can anyone out there in cyberland help as i have a big dent i
my head from banging it against my desk!

TIA,

MoonWeaze

--
MoonWeaze
-----------------------------------------------------------------------
MoonWeazel's Profile: http://www.excelforum.com/member.php...nfo&userid=211
View this thread: http://www.excelforum.com/showthread.php?threadid=47878