Paul Sansom
Board Regular
- Joined
- Jan 28, 2013
- Messages
- 178
- Office Version
- 2021
- 2016
- Platform
- Windows
Hi
I have a simple macro that I copy paste a range defined from a name
The range in the Macro is "Recipe1". I would like this to be defined from a cell that varies (from my Combo Box)
Recipe2 Recipe3 etc. I have already defined these ranges but....
I am struggling with the code to replace the .Range("Recipe1") at the begining of the macro below
The vaiable range text to repalce above is at cell $R$4 on "sheet3"
Does this make sense??? and can anyone help please???
Paul
I have a simple macro that I copy paste a range defined from a name
The range in the Macro is "Recipe1". I would like this to be defined from a cell that varies (from my Combo Box)
Recipe2 Recipe3 etc. I have already defined these ranges but....
I am struggling with the code to replace the .Range("Recipe1") at the begining of the macro below
The vaiable range text to repalce above is at cell $R$4 on "sheet3"
Does this make sense??? and can anyone help please???
Paul
Code:
Sub SampleRecipeLoad()
'
' SampleRecipeLoad Macro
' Load Chosen Recipe into the raws selection area
'
' Load Chosen Recipe
Workbooks("Recipe.xlsm").Worksheets("Sample Recipes").[B]Range("Recipe1").C[/B]opy _
Destination:=Workbooks("Recipe.xlsm").Worksheets("Recipe").Range("C9")
' Set Chocolate type to Milk and counrty check to EU
Workbooks("Recipe.xlsm").Worksheets("Recipe").Range("Input_ChocType") = "Milk"
Workbooks("Recipe.xlsm").Worksheets("Recipe").Range("Country_Output") = "EU"
' Close the Selection Panel Window
Unload UserForm2
End Sub