View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default problem in VB codes

I tested your code with 2/164 and it left me with 2. This does the same. Is
that what you want?

Sub removefraction()
Range("b13:b32").Replace "/164", ""
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"peyman" wrote in message
...
hi,
can anybody tell me why when I put a loop for the following code, it
doesn't
work!there's an error like:"unable to get the find property of the
worksheetfunction class"????!!!!!

Private Sub CommandButton4_Click()
Dim VAR As Variant
'For I = 13 To 32
VAR = Application.WorksheetFunction.Find("/164", Cells(13, 2))
If VAR = 1 Then
Cells(13, 2) = Application.WorksheetFunction.Substitute(Cells(13, 2),
"/164", "")
End If
End Sub

the above codes work but the loop below NO?

Private Sub CommandButton4_Click()
Dim VAR As Variant
For I = 13 To 32
VAR = Application.WorksheetFunction.Find("/164", Cells(I, 2))
If VAR = 1 Then
Cells(I, 2) = Application.WorksheetFunction.Substitute(Cells(I, 2),
"/164",
"")
Else
End If
Next
End Sub
thanx,