PC Review


Reply
Thread Tools Rate Thread

Convert Excel IF ISERROR formula to VBA

 
 
u473
Guest
Posts: n/a
 
      25th Nov 2010
Found = ""
For Each cell In Rng
'The following formula works in Excel
'nFound = left(B6,if(iserror(Find(" 3.",B6)),0,Find(" 3.",B6)))
'
' However, all my syntax variations to adapt it in VBA do not work.
Can you help me
'
nFound = "=left(cell.value,if iserror(Find(' 3.',cell.value)),
0,Find(' 3.',cell.value))"
If nFound <> Found Then
'Copy Row ........
Found = nFound
End If
Next cell
'
Help appreciated.
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      25th Nov 2010
Look at VBA's help for InStr. It's the VBA equivalent of Excel's =Find()/=Search().



On 11/24/2010 19:37, u473 wrote:
> Found = ""
> For Each cell In Rng
> 'The following formula works in Excel
> 'nFound = left(B6,if(iserror(Find(" 3.",B6)),0,Find(" 3.",B6)))
> '
> ' However, all my syntax variations to adapt it in VBA do not work.
> Can you help me
> '
> nFound = "=left(cell.value,if iserror(Find(' 3.',cell.value)),
> 0,Find(' 3.',cell.value))"
> If nFound<> Found Then
> 'Copy Row ........
> Found = nFound
> End If
> Next cell
> '
> Help appreciated.


--
Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Excel formula to Access Query formula SJW_OST Microsoft Access Queries 6 29th May 2008 07:55 PM
Using iserror in formula =?Utf-8?B?Zm9yZXN0OA==?= Microsoft Excel Misc 1 2nd Sep 2007 03:51 AM
ISERROR Formula Toyin Microsoft Excel Programming 1 16th Nov 2004 10:44 AM
IsError Formula Steph Microsoft Excel Programming 1 13th May 2004 08:21 PM
Re: Need an IsError Formula Allen Browne Microsoft Access Forms 0 19th Jul 2003 04:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:38 PM.