Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default formula in vba

how would you enter this formula using vba

=MID(B7,FIND(" ",B7)+1,LEN(B7)-FIND(" ",B7,1)) & "/"&MID(B8,FIND("
",B8)+1,LEN(B8)-FIND(" ",B8,1))

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default formula in vba

One way:

Range("A1").Formula = "=MID(B7,FIND("" "",B7)+1," & _
"LEN(B7)-FIND("" "",B7,1)) & ""/""&MID(B8," & _
"FIND("" "",B8)+1,LEN(B8)-FIND("" "",B8,1))"

Note that, just as in XL strings, quotation marks need to be doubled.

OTOH, I probably would make the function more efficient:

Range("A2").Formula = "=MID(B7,FIND("" "",B7)+1," & _
"32767) & ""/""&MID(B8," & "FIND("" "",B8)+1,32767)"

where 32767 is just a number large enough to contain the entire
remainder of the string.

In article ,
"Gary Keramidas" wrote:

how would you enter this formula using vba

=MID(B7,FIND(" ",B7)+1,LEN(B7)-FIND(" ",B7,1)) & "/"&MID(B8,FIND("
",B8)+1,LEN(B8)-FIND(" ",B8,1))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default formula in vba

i just entered it into a hidden cell for now and referenced that cell in the
code. it works

--


Gary


"Gary Keramidas" wrote in message
...
how would you enter this formula using vba

=MID(B7,FIND(" ",B7)+1,LEN(B7)-FIND(" ",B7,1)) & "/"&MID(B8,FIND("
",B8)+1,LEN(B8)-FIND(" ",B8,1))

--


Gary





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default formula in vba

thanks, i think that's what was messing me up, the double quotes. i just had
to make the cell references absolute because i sort after i create the
table.

thanks again

--


Gary


"JE McGimpsey" wrote in message
...
One way:

Range("A1").Formula = "=MID(B7,FIND("" "",B7)+1," & _
"LEN(B7)-FIND("" "",B7,1)) & ""/""&MID(B8," & _
"FIND("" "",B8)+1,LEN(B8)-FIND("" "",B8,1))"

Note that, just as in XL strings, quotation marks need to be doubled.

OTOH, I probably would make the function more efficient:

Range("A2").Formula = "=MID(B7,FIND("" "",B7)+1," & _
"32767) & ""/""&MID(B8," & "FIND("" "",B8)+1,32767)"

where 32767 is just a number large enough to contain the entire
remainder of the string.

In article ,
"Gary Keramidas" wrote:

how would you enter this formula using vba

=MID(B7,FIND(" ",B7)+1,LEN(B7)-FIND(" ",B7,1)) & "/"&MID(B8,FIND("
",B8)+1,LEN(B8)-FIND(" ",B8,1))



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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


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

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"