Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following was generated by the macro recorder:
Sheets("project01").Select Range("HL5:HZ8").Select Selection.Copy Sheets("Report").Select Range("DR502:EF505").Select ActiveSheet.Paste I need to be able to select the sheet that I am copying things from based on a cell value. For example, cell A1 could have "project06" or "project22" at any given time when this macro runs. How do I accomplish this "indirect" addressing? i.e., can I somehow use something like "Sheets("cell A1").Select"? (I am not a VB programmer.) Thank you. George |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don - Works perfectly - thank you very much
George "Don Guillett" wrote: You could use this but it is very seldom necessary to select Sheets(Range("f4").Value).Select Sheets(Range("f4").Value). Range("HL5:HZ8").Copy _ Sheets("Report").range("DR502:EF505") or if only values to copy (range must be the same size) Sheets("Report").range("DR502:EF505").value= _ Sheets(Range("f4").Value). Range("HL5:HZ8").value -- Don Guillett SalesAid Software "GeorgeF" wrote in message ... The following was generated by the macro recorder: Sheets("project01").Select Range("HL5:HZ8").Select Selection.Copy Sheets("Report").Select Range("DR502:EF505").Select ActiveSheet.Paste I need to be able to select the sheet that I am copying things from based on a cell value. For example, cell A1 could have "project06" or "project22" at any given time when this macro runs. How do I accomplish this "indirect" addressing? i.e., can I somehow use something like "Sheets("cell A1").Select"? (I am not a VB programmer.) Thank you. George |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
glad to help
-- Don Guillett SalesAid Software "GeorgeF" wrote in message ... Don - Works perfectly - thank you very much George "Don Guillett" wrote: You could use this but it is very seldom necessary to select Sheets(Range("f4").Value).Select Sheets(Range("f4").Value). Range("HL5:HZ8").Copy _ Sheets("Report").range("DR502:EF505") or if only values to copy (range must be the same size) Sheets("Report").range("DR502:EF505").value= _ Sheets(Range("f4").Value). Range("HL5:HZ8").value -- Don Guillett SalesAid Software "GeorgeF" wrote in message ... The following was generated by the macro recorder: Sheets("project01").Select Range("HL5:HZ8").Select Selection.Copy Sheets("Report").Select Range("DR502:EF505").Select ActiveSheet.Paste I need to be able to select the sheet that I am copying things from based on a cell value. For example, cell A1 could have "project06" or "project22" at any given time when this macro runs. How do I accomplish this "indirect" addressing? i.e., can I somehow use something like "Sheets("cell A1").Select"? (I am not a VB programmer.) Thank you. George |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get cell reference address | Excel Worksheet Functions | |||
Cell address without absolute reference | Excel Worksheet Functions | |||
worksheet reference returns address instead of value | Excel Worksheet Functions | |||
How do I get the cell address of a VLOOKUP reference? | Excel Worksheet Functions | |||
How to reference a cell address in VBA | Excel Programming |