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

I have text data in Column A (from A1 to A300), I would like to search each
cell in column A in order to get the position number of the character *
and the result in B cells, I am trying with the following code, but I have
problems in coding the A column :

For i=1 to 300
Cells(i,2).Formula="=Search("*","A",i,1)"
Next

Thanks for your help
--
Moises
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Search Formula

with activesheet
.range("b1:b300").formula = "=search(""~*"",a1,1)"
end with

The asterisk is a wildcard (represents any set of characters). So you have to
tell excel that you're really looking for that character.

The tilde (~) is the character that does this.

~* to find *
~? to find ?
~~ to find ~



Moises wrote:

I have text data in Column A (from A1 to A300), I would like to search each
cell in column A in order to get the position number of the character *
and the result in B cells, I am trying with the following code, but I have
problems in coding the A column :

For i=1 to 300
Cells(i,2).Formula="=Search("*","A",i,1)"
Next

Thanks for your help
--
Moises


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Search Formula

You may want to hide the errors if there is not asterisk:

With ActiveSheet
.Range("b1:b300").Formula _
= "=IF(ISERROR(SEARCH(""~*"",A1)),"""",SEARCH(""~*"" ,A1))"
End With



Moises wrote:

I have text data in Column A (from A1 to A300), I would like to search each
cell in column A in order to get the position number of the character *
and the result in B cells, I am trying with the following code, but I have
problems in coding the A column :

For i=1 to 300
Cells(i,2).Formula="=Search("*","A",i,1)"
Next

Thanks for your help
--
Moises


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Search Formula

Thanks again Dave.

--
Moises


"Dave Peterson" wrote:

You may want to hide the errors if there is not asterisk:

With ActiveSheet
.Range("b1:b300").Formula _
= "=IF(ISERROR(SEARCH(""~*"",A1)),"""",SEARCH(""~*"" ,A1))"
End With



Moises wrote:

I have text data in Column A (from A1 to A300), I would like to search each
cell in column A in order to get the position number of the character *
and the result in B cells, I am trying with the following code, but I have
problems in coding the A column :

For i=1 to 300
Cells(i,2).Formula="=Search("*","A",i,1)"
Next

Thanks for your help
--
Moises


--

Dave Peterson

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
Search Formula Dinesh Excel Worksheet Functions 4 December 13th 08 02:48 AM
Help with Search Formula JPS Excel Worksheet Functions 2 March 25th 08 01:23 PM
I need help - search formula Jamie Excel Worksheet Functions 4 September 28th 07 06:48 PM
another formula search, if any dribler2 Excel Discussion (Misc queries) 5 December 31st 06 01:50 PM
Search formula djm Excel Worksheet Functions 2 May 13th 05 12:30 PM


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

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"