Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that I want to be able to copy and paste from and to different
cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
justaguyfromk
What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The Cells that I want to copy from:
=CONCATENATE("R",V32) =CONCATENATE("S",V32) =CONCATENATE("T",V32) The Cells that I want to paste to: =CONCATENATE("Y",V32) =CONCATENATE("Z",V32) =CONCATENATE("AA",V32) The "V32" is a number that is generated by another macro from 1 to 30. All Cells will not be copied every day, so I need it to be able to copy only the ones specified by the V32 Macro With ActiveSheet If .Range("V32").Value "0" Then Range("??").Select Selection.Copy Range("??").Select I want the range be read from the cell because it may change depending on the V32 Macro "Charles Harmon" wrote: justaguyfromk What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe this
..Range(.Range("A1").Text).Copy Destination:=.Range(.Range("B1").Text) where A1 and B1 have the concatentate formulas. I assume the concatenate formulas display something that looks like a cell address and you want to use what they return as the ranges to copy from and paste to. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com justaguyfromky wrote: The Cells that I want to copy from: =CONCATENATE("R",V32) =CONCATENATE("S",V32) =CONCATENATE("T",V32) The Cells that I want to paste to: =CONCATENATE("Y",V32) =CONCATENATE("Z",V32) =CONCATENATE("AA",V32) The "V32" is a number that is generated by another macro from 1 to 30. All Cells will not be copied every day, so I need it to be able to copy only the ones specified by the V32 Macro With ActiveSheet If .Range("V32").Value "0" Then Range("??").Select Selection.Copy Range("??").Select I want the range be read from the cell because it may change depending on the V32 Macro "Charles Harmon" wrote: justaguyfromk What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This assumes your formula is in A1 thru B3.
If Range("V32") < 0 Then For i = 1 To 3 myrng = Cells(i, 1).Value myrng1 = Cells(i, 2).Value Range(myrng).Copy Destination:=Range(myrng1) Next End If Charles "Dick Kusleika" wrote in message ... Maybe this .Range(.Range("A1").Text).Copy Destination:=.Range(.Range("B1").Text) where A1 and B1 have the concatentate formulas. I assume the concatenate formulas display something that looks like a cell address and you want to use what they return as the ranges to copy from and paste to. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com justaguyfromky wrote: The Cells that I want to copy from: =CONCATENATE("R",V32) =CONCATENATE("S",V32) =CONCATENATE("T",V32) The Cells that I want to paste to: =CONCATENATE("Y",V32) =CONCATENATE("Z",V32) =CONCATENATE("AA",V32) The "V32" is a number that is generated by another macro from 1 to 30. All Cells will not be copied every day, so I need it to be able to copy only the ones specified by the V32 Macro With ActiveSheet If .Range("V32").Value "0" Then Range("??").Select Selection.Copy Range("??").Select I want the range be read from the cell because it may change depending on the V32 Macro "Charles Harmon" wrote: justaguyfromk What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This formula works great!!!
But... I need it to paste just the values and not the formula... Any Ideas for that You have already saved me so much time with this help Thank you, Looking forward to your reply "Dick Kusleika" wrote: Maybe this ..Range(.Range("A1").Text).Copy Destination:=.Range(.Range("B1").Text) where A1 and B1 have the concatentate formulas. I assume the concatenate formulas display something that looks like a cell address and you want to use what they return as the ranges to copy from and paste to. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com justaguyfromky wrote: The Cells that I want to copy from: =CONCATENATE("R",V32) =CONCATENATE("S",V32) =CONCATENATE("T",V32) The Cells that I want to paste to: =CONCATENATE("Y",V32) =CONCATENATE("Z",V32) =CONCATENATE("AA",V32) The "V32" is a number that is generated by another macro from 1 to 30. All Cells will not be copied every day, so I need it to be able to copy only the ones specified by the V32 Macro With ActiveSheet If .Range("V32").Value "0" Then Range("??").Select Selection.Copy Range("??").Select I want the range be read from the cell because it may change depending on the V32 Macro "Charles Harmon" wrote: justaguyfromk What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ..Range(.Range("B1").Text).Value = .Range(.Range("A1").Text).Value should do it for you if you just want values. If you want values and formatting, then you'll need to use a Copy and a PasteSpecial xPasteValues on two separate lines - but the range reference remains the same. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com justaguyfromky wrote: This formula works great!!! But... I need it to paste just the values and not the formula... Any Ideas for that You have already saved me so much time with this help Thank you, Looking forward to your reply "Dick Kusleika" wrote: Maybe this ..Range(.Range("A1").Text).Copy Destination:=.Range(.Range("B1").Text) where A1 and B1 have the concatentate formulas. I assume the concatenate formulas display something that looks like a cell address and you want to use what they return as the ranges to copy from and paste to. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com justaguyfromky wrote: The Cells that I want to copy from: =CONCATENATE("R",V32) =CONCATENATE("S",V32) =CONCATENATE("T",V32) The Cells that I want to paste to: =CONCATENATE("Y",V32) =CONCATENATE("Z",V32) =CONCATENATE("AA",V32) The "V32" is a number that is generated by another macro from 1 to 30. All Cells will not be copied every day, so I need it to be able to copy only the ones specified by the V32 Macro With ActiveSheet If .Range("V32").Value "0" Then Range("??").Select Selection.Copy Range("??").Select I want the range be read from the cell because it may change depending on the V32 Macro "Charles Harmon" wrote: justaguyfromk What does the formula look like? Charles "justaguyfromky" wrote in message ... I have a macro that I want to be able to copy and paste from and to different cells depending on other criteria. I have a cell with a concatenate formula that puts the actual cells that I want to copy from and to. My question is... How do I get the macro to read the cell that has the range I want to copy from and paste into to put the value of the cell as the range in the macro? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro using a cell reference | Excel Discussion (Misc queries) | |||
Cell Reference Macro | Excel Discussion (Misc queries) | |||
cell reference in macro | Excel Discussion (Misc queries) | |||
Cell Reference in a Macro | Excel Programming | |||
run a macro from a cell reference | Excel Programming |