#1   Report Post  
Posted to microsoft.public.excel.programming
KK KK is offline
external usenet poster
 
Posts: 61
Default Find

123FF+,456 ,789FF+ (Text format )

How can i find the "FF" and return the number before "FF" ?I had try to use
Find method in excel, but it only can help me to find out first "FF".
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find

=MID(A1,FIND("FF",A1)-1,1)
Regards,
Stefi

€žKK€ ezt Ă*rta:

123FF+,456 ,789FF+ (Text format )

How can i find the "FF" and return the number before "FF" ?I had try to use
Find method in excel, but it only can help me to find out first "FF".

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find

Or, if you want it as a VBA line:
?MID(range("A1"),instr(1,range("A1"),"FF")-1,1)

Regards,
Stefi



€žKK€ ezt Ă*rta:

123FF+,456 ,789FF+ (Text format )

How can i find the "FF" and return the number before "FF" ?I had try to use
Find method in excel, but it only can help me to find out first "FF".

  #4   Report Post  
Posted to microsoft.public.excel.programming
KK KK is offline
external usenet poster
 
Posts: 61
Default Find

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?
  #5   Report Post  
Posted to microsoft.public.excel.programming
KK KK is offline
external usenet poster
 
Posts: 61
Default Find

I means save two value before "FF".


"KK" wrote:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find

Number off FFs:
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2

Do you mean that var1 should be 123, var2 should be 789? If so, are these
substrings always 3 character long? Do you want the variables be strings os
numbers?

Stefi


€žKK€ ezt Ă*rta:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?

  #7   Report Post  
Posted to microsoft.public.excel.programming
KK KK is offline
external usenet poster
 
Posts: 61
Default Find

Ya , i would like to save variable a as 123 , and variable b as 789 .But the
string no always 3 character long , sometime will be 2 or one , but each
123FF,456,789FF is divide by a comma.

"Stefi" wrote:

Number off FFs:
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2

Do you mean that var1 should be 123, var2 should be 789? If so, are these
substrings always 3 character long? Do you want the variables be strings os
numbers?

Stefi


€žKK€ ezt Ă*rta:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find

Sub test()
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2
FFpos1 = InStr(1, Range("A1"), "FF")
var_a = Val(Mid(Range("A1"), 1, FFpos1 - 1))
FFpos2 = InStr(FFpos1 + 2, Range("A1"), "FF")
commapos = InStrRev(Range("A1"), ",", FFpos2)
var_b = Val(Mid(Range("A1"), commapos + 1, FFpos2 - commapos - 1))
End Sub

Regards,
Stefi


€žKK€ ezt Ă*rta:

Ya , i would like to save variable a as 123 , and variable b as 789 .But the
string no always 3 character long , sometime will be 2 or one , but each
123FF,456,789FF is divide by a comma.

"Stefi" wrote:

Number off FFs:
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2

Do you mean that var1 should be 123, var2 should be 789? If so, are these
substrings always 3 character long? Do you want the variables be strings os
numbers?

Stefi


€žKK€ ezt Ă*rta:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?

  #9   Report Post  
Posted to microsoft.public.excel.programming
KK KK is offline
external usenet poster
 
Posts: 61
Default Find

Thanks a lot !!!Stefi you been great help !!

KK

"Stefi" wrote:

Sub test()
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2
FFpos1 = InStr(1, Range("A1"), "FF")
var_a = Val(Mid(Range("A1"), 1, FFpos1 - 1))
FFpos2 = InStr(FFpos1 + 2, Range("A1"), "FF")
commapos = InStrRev(Range("A1"), ",", FFpos2)
var_b = Val(Mid(Range("A1"), commapos + 1, FFpos2 - commapos - 1))
End Sub

Regards,
Stefi


€žKK€ ezt Ă*rta:

Ya , i would like to save variable a as 123 , and variable b as 789 .But the
string no always 3 character long , sometime will be 2 or one , but each
123FF,456,789FF is divide by a comma.

"Stefi" wrote:

Number off FFs:
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2

Do you mean that var1 should be 123, var2 should be 789? If so, are these
substrings always 3 character long? Do you want the variables be strings os
numbers?

Stefi


€žKK€ ezt Ă*rta:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Find

You are welcome! Thanks for the feedback!
Stefi

€žKK€ ezt Ă*rta:

Thanks a lot !!!Stefi you been great help !!

KK

"Stefi" wrote:

Sub test()
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2
FFpos1 = InStr(1, Range("A1"), "FF")
var_a = Val(Mid(Range("A1"), 1, FFpos1 - 1))
FFpos2 = InStr(FFpos1 + 2, Range("A1"), "FF")
commapos = InStrRev(Range("A1"), ",", FFpos2)
var_b = Val(Mid(Range("A1"), commapos + 1, FFpos2 - commapos - 1))
End Sub

Regards,
Stefi


€žKK€ ezt Ă*rta:

Ya , i would like to save variable a as 123 , and variable b as 789 .But the
string no always 3 character long , sometime will be 2 or one , but each
123FF,456,789FF is divide by a comma.

"Stefi" wrote:

Number off FFs:
NoOfFF = Len(Range("A1")) - Len(Replace(Range("A1"), "FF", "")) / 2

Do you mean that var1 should be 123, var2 should be 789? If so, are these
substrings always 3 character long? Do you want the variables be strings os
numbers?

Stefi


€žKK€ ezt Ă*rta:

Hi Stefi ,

Thanks for your help !!!^^
But if i would like save the two value into 2 variable , is it possible ?
and have any function to count how many "FF" in a cell?

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
Find and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 11:03 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"