Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Create formula in VBA
Hello
Sub makeformulae() Dim frng As Range Const sFormula As String = _ "=if(a9="""","""",if(isna(vlookup(a9,råb1,3,false) )," & _ """"",(vlookup(a9,råb1,3,false))))" Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng .Formula = sFormula .Value = .Value End With End Sub Does anybody know how I make this formula dynamic to go with the range - so that the a9-lookup is returned in o9 and the a10-lookup is returned in o10 etc. Any thoughts? Thanks in advance. /Heine |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a certain type of Excel formula? | Excel Worksheet Functions | |||
How do I create a formula by percentage within a formula? | Excel Worksheet Functions | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
How do I create a 26 'tier' IF formula? | Excel Discussion (Misc queries) | |||
How to create specific formula | Excel Worksheet Functions |