Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"