would anybody help please?

T

TheGodfather

i have the following problem with this code :

Private Sub DeleteButton_Click()
Dim i
If Not Cleared Then
With Sheets("Sheet1")
i = Application.Match(CVar(Me.ctrlList.Value), Range("C:C"),
0)
Cleared = True
.Range(("C") & i).EntireRow.Delete Shift:=xlUp
End With
End If
Cleared = False

this code deletes only the non numeric values but in row C i have
numeric and text values so it works just for text whenever i go to a
numeric it gives me error can u please help improving it to delete
everything i ask it to,
NB. if CVar is changed to Cint i have the same problem but the other
way round, it delets only numerics, but i want to delete anything
any help appreciated
cheers
 
D

Don Guillett

Start over by stating exactly what you want to do. Clear one row (which) or
all rows in col c that meet a criteria?
 
G

Guest

I keep seeing the terms:

If Not Cleared, Cleared = True and Cleared = False

but I find no reference to them in the VBA help files. Where
do these come from?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top