Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Advice on formula Please

Good Morning, i got the following code from Tom Ogilvy which works
really great & would like to know if one can use the same formula to
search for a number e.g. "0" or "1" ?

On Error Resume Next
set rng = columns(22).Specialcells(xlConstants,xlErrors)
On Error goto 0
If not rng is nothing then
Intersect(Range("V:AB"),rng.EntireRow).ClearConten ts
End If

Sorry for the ignorance, but i am fairly new to this game

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Advice on formula Please

There's nothing built into .specialcells to look for an individual value (like 0
or 1).

But if you don't have any errors in that range, you could change the 0s (or 1s)
to #n/a's and then use your existing code.

You could always loop through the cells.

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

With ActiveSheet
Set myRng = .Range(.Cells(1, 22), .Cells(.Rows.Count, 22).End(xlUp))
For Each myCell In myRng.Cells
If IsEmpty(myCell) Then
'skip it??
Else
If myCell.Value = 0 _
Or myCell.Value = 1 Then
Intersect(.Range("V:AB"), myCell.EntireRow).ClearContents
End If
End If
Next myCell
End With

End Sub



Tempy wrote:

Good Morning, i got the following code from Tom Ogilvy which works
really great & would like to know if one can use the same formula to
search for a number e.g. "0" or "1" ?

On Error Resume Next
set rng = columns(22).Specialcells(xlConstants,xlErrors)
On Error goto 0
If not rng is nothing then
Intersect(Range("V:AB"),rng.EntireRow).ClearConten ts
End If

Sorry for the ignorance, but i am fairly new to this game

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Advice on formula Please

Hi Dave,

I tried your code and it does not seem to work. What i did omit to say
is that the the 0 is a result od a Vlookup, findine the lookup value on
both sheets but the required field is empty. Could this be why it is not
working ? The entire column is then copied and pasted back as just
values to get rid of the formula's.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Advice on formula Please

Help please !!!
This is really frustrating me, gonna go home and have a beer !!
Speak again in the morning.

Regards

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Advice on formula Please

I would say your description of your problem in response to Dave's solution
is so incomprehensible and lacking detail that your chances of an answer are
very small.

The clearer your explanation of what you are trying to do, the more likely
you are to receive assistance. Based on your first posting in this thread,
Dave's solution is quite adequate. Your response

What i did omit to say
is that the the 0 is a result od a Vlookup, findine the lookup value on
both sheets but the required field is empty.


Who knows what the "required field" is or the significance of it being
empty. Vlookup works on one range. How does it result in a zero for
finding the "lookup" value on "both sheets". In any event, that should be
immaterial. Dave's code loops through column V and clears cells where a
cell in column V has a numeric value of zero or a 1. Again, it should be
immaterial how that value is produced, even if you have replaced the formula
in the cell with the value it displayed.

It is unclear why you say it doesn't work.

--
Regards,
To Ogilvy


"Tempy" wrote in message
...
Help please !!!
This is really frustrating me, gonna go home and have a beer !!
Speak again in the morning.

Regards

Tempy

*** Sent via Developersdex http://www.developersdex.com ***



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula advice Sundew Chocobo Excel Discussion (Misc queries) 5 October 7th 08 05:59 PM
Copy Down A formula advice...... Dermot Excel Discussion (Misc queries) 12 November 22nd 07 12:19 AM
Formula Advice Ken[_2_] Excel Worksheet Functions 7 November 11th 07 12:04 AM
need formula advice CdnMichael Excel Worksheet Functions 1 April 24th 06 12:15 AM
Formula Advice Needed Brad_A Excel Discussion (Misc queries) 1 March 3rd 05 06:29 PM


All times are GMT +1. The time now is 09:14 PM.

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"