Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Macro cell reference help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Macro cell reference help


..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?



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Macro cell reference help

This is now deleting the formula from the cell to be copied, the formula
needs to stay in the original location and just send the values to the
destination cells.

I think that we almost have this one down.

PS. I added your web site to my list of favorites, found some useful
information that I may be able to use as I try to continue my VBA skills.

Thanks again

"Dick Kusleika" wrote:


..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?




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Macro cell reference help

The formula I sent should not copy the formula in A1 it should only copy and
paste to location determined by your CONCATENATE formula.
If value in V32 = 1 the =CONCATENATE("R",V32)= "R1" and
=CONCATENATE("Y",V32)= "Y1" my formula now looks at R1 value and paste it to
Y1.

Charles




"justaguyfromky" wrote in message
...
This is now deleting the formula from the cell to be copied, the formula
needs to stay in the original location and just send the values to the
destination cells.

I think that we almost have this one down.

PS. I added your web site to my list of favorites, found some useful
information that I may be able to use as I try to continue my VBA skills.

Thanks again

"Dick Kusleika" wrote:


..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?






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Macro cell reference help

That should not be happening. There must be something else going on there.
Post all the code that you're using.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

justaguyfromky wrote:
This is now deleting the formula from the cell to be copied, the
formula needs to stay in the original location and just send the
values to the destination cells.

I think that we almost have this one down.

PS. I added your web site to my list of favorites, found some useful
information that I may be able to use as I try to continue my VBA
skills.

Thanks again

"Dick Kusleika" wrote:


..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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro using a cell reference Jason Falzon[_2_] Excel Discussion (Misc queries) 3 March 24th 10 04:16 PM
Cell Reference Macro Scott Excel Discussion (Misc queries) 3 June 16th 09 04:13 PM
cell reference in macro AJB Excel Discussion (Misc queries) 2 August 7th 07 04:22 PM
Cell Reference in a Macro Tim Excel Programming 1 April 28th 04 06:31 PM
run a macro from a cell reference spence[_3_] Excel Programming 2 December 9th 03 09:36 PM


All times are GMT +1. The time now is 02:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"