ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   would anybody help please? (https://www.excelbanter.com/excel-programming/389994-would-anybody-help-please.html)

TheGodfather[_2_]

would anybody help please?
 
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


Jim Jackson

would anybody help please?
 
Can you fit "Selection.ClearContents" into the equation?
--
Best wishes,

Jim


"TheGodfather" wrote:

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



Don Guillett

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

--
Don Guillett
SalesAid Software

"TheGodfather" wrote in message
ps.com...
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



JLGWhiz

would anybody help please?
 
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?

"TheGodfather" wrote:

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



Tom Ogilvy

would anybody help please?
 
I think they are called variables.

--
Regards,
Tom Ogilvy


"JLGWhiz" wrote in message
...
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?

"TheGodfather" wrote:

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






All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com