Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tam
 
Posts: n/a
Default using search function in macro

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

Look in vba help for using functions in macros or just use the FIND method
in vba instead. Also in HELP.

--
Don Guillett
SalesAid Software

"tam" wrote in message
...
cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?



  #3   Report Post  
David Hepner
 
Posts: n/a
Default

Try this:

Range("A1").Formula = "=Search("":"",Sheet2!cells(1,1),1)"



"tam" wrote:

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?

  #4   Report Post  
tam
 
Posts: n/a
Default

Thanks, David. However, when I used this formula, I got "#NAME?". It looks
like the formula doesn't like the type of cell reference Cells(1,1). If I
changed cells(1,1) to A1, then everything worked fine. However, I have a
long list and I need to do a loop later on.
Regards,
Minh

"David Hepner" wrote:

Try this:

Range("A1").Formula = "=Search("":"",Sheet2!cells(1,1),1)"



"tam" wrote:

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?

  #5   Report Post  
David Hepner
 
Posts: n/a
Default

This should work for you:

Worksheets("Sheet1").Cells(1, 1).Formula =
"=Search("":"",Sheet2!cells(1,1),1)"

"tam" wrote:

Thanks, David. However, when I used this formula, I got "#NAME?". It looks
like the formula doesn't like the type of cell reference Cells(1,1). If I
changed cells(1,1) to A1, then everything worked fine. However, I have a
long list and I need to do a loop later on.
Regards,
Minh

"David Hepner" wrote:

Try this:

Range("A1").Formula = "=Search("":"",Sheet2!cells(1,1),1)"



"tam" wrote:

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?



  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

Depending on what your loop looks like...

Maybe you could do it like this instead of the loop:

Range("a1:A99").formula = "=Search("":"",Sheet2!A1,1)"


tam wrote:

Thanks, David. However, when I used this formula, I got "#NAME?". It looks
like the formula doesn't like the type of cell reference Cells(1,1). If I
changed cells(1,1) to A1, then everything worked fine. However, I have a
long list and I need to do a loop later on.
Regards,
Minh

"David Hepner" wrote:

Try this:

Range("A1").Formula = "=Search("":"",Sheet2!cells(1,1),1)"



"tam" wrote:

cells(1, 1).Formula = "=Search("":"",Sheet2!cells(1,1),1)"
What is wrong with this formula? How do I use this type of cell reference
in a formula?


--

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
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
VBA Search function tamato43 Excel Discussion (Misc queries) 0 March 29th 05 08:09 PM
FAQ Spreadsheet with search function murphyz Excel Discussion (Misc queries) 0 March 19th 05 09:24 PM
SEARCH function #VALUE! result Mike Boerne Excel Worksheet Functions 3 January 5th 05 08:53 PM


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