Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi everybody
My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false*))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Heine" wrote in message oups.com... Hi everybody My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false* ))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If Bob's formula didn't work, then I'd try:
Const sFormula As String = _ "=if(a9="""","""",if(isna(vlookup(a9,råb1,3,false) ),""""," & _ "(vlookup(a9,råb1,3,false))))" Semicolons have been replaces with commas--VBA is pretty USA centric. Bob Phillips wrote: 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 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Heine" wrote in message oups.com... Hi everybody My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false* ))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Bob,
thanks for yout input. However this line doesn´t seem to work: ..Formula = sFormula "Application or object defined error" it says. Any thoughts? /Heine Dave Peterson wrote: If Bob's formula didn't work, then I'd try: Const sFormula As String = _ "=if(a9="""","""",if(isna(vlookup(a9,råb1,3,false) ),""""," & _ "(vlookup(a9,råb1,3,false))))" Semicolons have been replaces with commas--VBA is pretty USA centric. Bob Phillips wrote: 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 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Heine" wrote in message oups.com... Hi everybody My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false* ))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Do you really have a range named: råb1
Heine wrote: Hi Bob, thanks for yout input. However this line doesn´t seem to work: .Formula = sFormula "Application or object defined error" it says. Any thoughts? /Heine Dave Peterson wrote: If Bob's formula didn't work, then I'd try: Const sFormula As String = _ "=if(a9="""","""",if(isna(vlookup(a9,råb1,3,false) ),""""," & _ "(vlookup(a9,råb1,3,false))))" Semicolons have been replaces with commas--VBA is pretty USA centric. Bob Phillips wrote: 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 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Heine" wrote in message oups.com... Hi everybody My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false* ))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine -- Dave Peterson -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
It shouldn´t matter should it? I can always change it to the
traditional way if it´s a problem Dave Peterson wrote: Do you really have a range named: råb1 Heine wrote: Hi Bob, thanks for yout input. However this line doesn´t seem to work: .Formula = sFormula "Application or object defined error" it says. Any thoughts? /Heine Dave Peterson wrote: If Bob's formula didn't work, then I'd try: Const sFormula As String = _ "=if(a9="""","""",if(isna(vlookup(a9,råb1,3,false) ),""""," & _ "(vlookup(a9,råb1,3,false))))" Semicolons have been replaces with commas--VBA is pretty USA centric. Bob Phillips wrote: 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 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Heine" wrote in message oups.com... Hi everybody My formula looks exactly like this: Sub makeformulae() Sheets("Bogholderi").Select Set frng = Range("O9:O" & Cells(Rows.Count, "O").End(xlUp).Row) With frng Formula = "=if(a9="";"";if(isna(vlookup(a9;råb1;3;false));"" ;(vlookup(a9;råb1;3;false* ))))" Formula = .Value 'changes to a value if desired End With End Sub As I understand it this should set my defined formula active in all the cells in column O from row 9 - that is it should return the result of the formula in the entire column (almost) - but nothing happens. Any thoughts? And what can I use this line for? Formula = .Value 'changes to a value if desired /Heine -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
How to stop Excel remembering/loading macro from previously opened Workbook | Excel Discussion (Misc queries) | |||
Editing a simple macro | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions |