Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)"
this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
This places the formula in the cell. What if I want the result of the formula instead? Thank you. Eric. "Tom Ogilvy" wrote in message ... ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)" this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set Client_List = Range("A1") ' A1 contains something like 10
Set Client_Selection = Range("B1:B200") ActiveCell.Value = Application.Index(Client_List, Client_Selection,1) -- Regards, Tom Ogilvy "Eric" wrote in message ... Tom, This places the formula in the cell. What if I want the result of the formula instead? Thank you. Eric. "Tom Ogilvy" wrote in message ... ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)" this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom.
"Tom Ogilvy" wrote in message ... Set Client_List = Range("A1") ' A1 contains something like 10 Set Client_Selection = Range("B1:B200") ActiveCell.Value = Application.Index(Client_List, Client_Selection,1) -- Regards, Tom Ogilvy "Eric" wrote in message ... Tom, This places the formula in the cell. What if I want the result of the formula instead? Thank you. Eric. "Tom Ogilvy" wrote in message ... ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)" this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With ActiveCell
.Formula = "=Index(Client_List, Client_Selection,1)" .Value = .Value End With -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Tom Ogilvy" wrote in message ... ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)" this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
Thank you. "Bob Phillips" wrote in message ... With ActiveCell .Formula = "=Index(Client_List, Client_Selection,1)" .Value = .Value End With -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Tom Ogilvy" wrote in message ... ActiveCell.Formula = "=Index(Client_List, Client_Selection,1)" this assumes Client_List and Client_Selection are defined names/ranges (Insert=Name=Define) -- Regards, Tom Ogilvy "Eric" wrote: Hello, I am trying to write a quick macro to insert the content of a specific cell from a 1 column array. I am not sure of the syntax when you use an existing function in a macro, which probably explain why it does not work. Here's the quick macro Thank you. Eric. Sub Macro1() ' ' Macro1 Macro ActiveCell.FormulaR1C1 = Index(Client_List, Client_Selection) Range("K20").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to add a formula using a macro | Excel Worksheet Functions | |||
Macro formula help | Excel Worksheet Functions | |||
Formula - Macro | Excel Discussion (Misc queries) | |||
Formula or Macro Help | Excel Discussion (Misc queries) | |||
Do I need a formula or Macro? | Excel Worksheet Functions |