View Single Post
  #3   Report Post  
JD Ami
 
Posts: n/a
Default

Thanks, Bernard!

Works if all ranges below are on same sheet, but in my app A, B,....D are all
in a table on another sheet.

Also, prior to asking for help, I tried another approach... but could not get
the syntax required to make it work.

' Dim cycle As String
' cycle = Evaluate(Range("c_cycle")).Value
' Range("cycle").Select
' Selection.Copy
' Range("c_input_top").Select
' ActiveSheet.Paste
' Application.CutCopyMode = False


Bernard Liengme wrote:

This will give you a start
Sub try()
test =Ucase( Range("E1"))
Select Case test
Case "A"
Range("A").Select
Case "B"
Range("B").Select
Case "C"
Range("C_").Select
End Select
Selection.Copy
Range("E5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("E1").Select
End Sub

Note you cannot have a range called C it must be C_ (likewise R_)
The entry in E1 must be committed (with ENTER key or green checkmark in
Formula Bar) before running macro
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"JD Ami" wrote in message
...
I have four ranges named A, B, C, D.
I need to be able to copy (and paste) one of them when its name is
entered in a cell.
What is the macro syntax to get the value in a cell and use it to select
a range, please?
I would attach this macro to a button (which I know how to do) to allow
the user to enter the range name and click the button to copy it to a
fixed location (that I know how to specify)
Thanks!.