Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default Formula in macro or in sheet/cells?

Hi,

I would like to put my lookup formula in the macro instead of in the
cells.

=IF(A9="";"";IF(ISNA(VLOOKUP(A9;raab1;3;FALSE));"" ;(VLOOKUP(A9;raab1;3;FALSE))))


Any suggestion as to how this is done most easily? What are the
implications of this? Is it at all smart? The idea is that I can use
the macro in many sheets instead of copying the formulas from sheet to
sheet.

Thanks in advance!

/Heine

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Formula in macro or in sheet/cells?

modify this idea to suit
Sub makeformulae()
Set frng = Range("c16:c" & Cells(Rows.Count, "a").End(xlUp).Row)
With frng
.Formula = "=vlookup(a16,$a$16:$b$22,2,0)"
.Formula = .Value'changes to a value if desired
End With
End Sub

--
Don Guillett
SalesAid Software

"Heine" wrote in message
oups.com...
Hi,

I would like to put my lookup formula in the macro instead of in the
cells.

=IF(A9="";"";IF(ISNA(VLOOKUP(A9;raab1;3;FALSE));"" ;(VLOOKUP(A9;raab1;3;FALSE))))


Any suggestion as to how this is done most easily? What are the
implications of this? Is it at all smart? The idea is that I can use
the macro in many sheets instead of copying the formulas from sheet to
sheet.

Thanks in advance!

/Heine



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 49
Default Formula in macro or in sheet/cells?

Thanks for the template, Don - what is frng?

/Heine

Don Guillett wrote:
modify this idea to suit
Sub makeformulae()
Set frng = Range("c16:c" & Cells(Rows.Count, "a").End(xlUp).Row)
With frng
.Formula = "=vlookup(a16,$a$16:$b$22,2,0)"
.Formula = .Value'changes to a value if desired
End With
End Sub

--
Don Guillett
SalesAid Software

"Heine" wrote in message
oups.com...
Hi,

I would like to put my lookup formula in the macro instead of in the
cells.

=IF(A9="";"";IF(ISNA(VLOOKUP(A9;raab1;3;FALSE));"" ;(VLOOKUP(A9;raab1;3;FALSE))))


Any suggestion as to how this is done most easily? What are the
implications of this? Is it at all smart? The idea is that I can use
the macro in many sheets instead of copying the formulas from sheet to
sheet.

Thanks in advance!

/Heine


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 value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


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