Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Equivalent VBA for MID/FIND formula

I'm stumped. I have a mid-find formula that I can create on a
worksheet [=MID(B2,FIND("categoryId=",B2)+11,5)] that I can't get to do
what I want in VBA. What I need VBA to do is use this formula but use
a range variable for a cell I've already DIM'd and SET instead of B2.

Or, is there a way to turn the above forumula into a VNA function? MID
works the same in VBA and Excel, but I can't find what in VBA works the
same as Excel's FIND. VBA's find is like the Ctrl-F find capabilities.
TIA,
Jim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Equivalent VBA for MID/FIND formula

I had the same problem and someone helped me out.
It's hard to 'find', but it's the instr function that you can get to work
the same way as a find. x=instr(a,lookin,lookfor,kindofcompare)
a is the start position in lookin
x= where it was found.

" wrote:

I'm stumped. I have a mid-find formula that I can create on a
worksheet [=MID(B2,FIND("categoryId=",B2)+11,5)] that I can't get to do
what I want in VBA. What I need VBA to do is use this formula but use
a range variable for a cell I've already DIM'd and SET instead of B2.

Or, is there a way to turn the above forumula into a VNA function? MID
works the same in VBA and Excel, but I can't find what in VBA works the
same as Excel's FIND. VBA's find is like the Ctrl-F find capabilities.
TIA,
Jim


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Equivalent VBA for MID/FIND formula

or

myVar = Ecaluate("[=MID(" & rng.Address(False,False) &
",FIND("categoryId=",(" & rng.Address(False,False) & ")+11,5)")

--
HTH

Bob Phillips

"Neal Zimm" wrote in message
...
I had the same problem and someone helped me out.
It's hard to 'find', but it's the instr function that you can get to work
the same way as a find. x=instr(a,lookin,lookfor,kindofcompare)
a is the start position in lookin
x= where it was found.

" wrote:

I'm stumped. I have a mid-find formula that I can create on a
worksheet [=MID(B2,FIND("categoryId=",B2)+11,5)] that I can't get to do
what I want in VBA. What I need VBA to do is use this formula but use
a range variable for a cell I've already DIM'd and SET instead of B2.

Or, is there a way to turn the above forumula into a VNA function? MID
works the same in VBA and Excel, but I can't find what in VBA works the
same as Excel's FIND. VBA's find is like the Ctrl-F find capabilities.
TIA,
Jim




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Equivalent VBA for MID/FIND formula

The InStr function in vba is similar to Find() in Excel, but you can make use
of an Excel worksheet function in vba as a member of the
application.worksheetfunction collection. For example;

Application.WorksheetFunction.Find(myText,myString )

would return the location of the value of myText in myString just as if in
Excel.

Hope that helps.

Tom

" wrote:

I'm stumped. I have a mid-find formula that I can create on a
worksheet [=MID(B2,FIND("categoryId=",B2)+11,5)] that I can't get to do
what I want in VBA. What I need VBA to do is use this formula but use
a range variable for a cell I've already DIM'd and SET instead of B2.

Or, is there a way to turn the above forumula into a VNA function? MID
works the same in VBA and Excel, but I can't find what in VBA works the
same as Excel's FIND. VBA's find is like the Ctrl-F find capabilities.
TIA,
Jim


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Equivalent VBA for MID/FIND formula

Just to reduce the possibility of confusion from a typo,

Ecaluate
should be
Evaluate

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
or

myVar = Ecaluate("[=MID(" & rng.Address(False,False) &
",FIND("categoryId=",(" & rng.Address(False,False) & ")+11,5)")

--
HTH

Bob Phillips

"Neal Zimm" wrote in message
...
I had the same problem and someone helped me out.
It's hard to 'find', but it's the instr function that you can get to

work
the same way as a find. x=instr(a,lookin,lookfor,kindofcompare)
a is the start position in lookin
x= where it was found.

" wrote:

I'm stumped. I have a mid-find formula that I can create on a
worksheet [=MID(B2,FIND("categoryId=",B2)+11,5)] that I can't get to

do
what I want in VBA. What I need VBA to do is use this formula but use
a range variable for a cell I've already DIM'd and SET instead of B2.

Or, is there a way to turn the above forumula into a VNA function?

MID
works the same in VBA and Excel, but I can't find what in VBA works

the
same as Excel's FIND. VBA's find is like the Ctrl-F find

capabilities.
TIA,
Jim






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
The equivalent of a Find & Replace option Pat Charts and Charting in Excel 4 September 17th 08 04:22 AM
EQUIVALENT for this FORMULA , please ytayta555 Excel Worksheet Functions 1 July 3rd 08 10:25 PM
How do I create an equivalent VLOOKUP function using FIND? dan Excel Worksheet Functions 8 August 17th 05 04:43 PM
Formula equivalent of CurrentRegion bdr200 Excel Worksheet Functions 1 June 14th 05 11:41 AM
I need the equivalent formula for this UDF Don[_18_] Excel Programming 3 September 8th 04 04:05 AM


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

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

About Us

"It's about Microsoft Excel"