View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default several questions

Q1: The syntax looks fine. I wonder if you don't have a cell selected (maybe
a chart instead) or your workbook is not visible or something?

Q2: I posted this code earlier. It deletes rows which contain the letter f
I'm not 100% certain what you mean by delete blank cells. Do you mean blank
rows after matching 'f' or just all blank rows?

Sub test()
Const cColumn = 2, cSearch = "f"
Dim i As Long, lngLastRow As Long

With ActiveSheet
lngLastRow = .Cells(Rows.Count, cColumn).End(xlUp).Row

For i = lngLastRow To 1 Step -1
If InStr(1, .Cells(i, cColumn).Value, cSearch) 0 Then
.Rows(i).Delete xlShiftUp
End If
Next
End With
End Sub



--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ksnapp " wrote in message
...
Hello,

question 1:

can somebody please explain to me what the type mismatch runtime error
means? Here is the code that gets Highlighted when I run the sub.

If ActiveCell = "" then

I don't yet have the help file for VBA installed and can't make the sub
work becuase i don't understand

question 2:

I need to make another sub that will search through a column and delete
rows that countain certain text and the blank cells beneth them, any
takers?


thank you


---
Message posted from http://www.ExcelForum.com/