Paste cell to last row in range

J

Jack

i'm trying to copy a formula from E1 to a range of cells in column c from row
2 to the lastrow in the column. Here is my code

Sub Test
dim lastrow
application.goto reference:="r65536c1"
selection.end(xlup).select
lastrow = activecell.row

range ("E1").select
selection.copy
set myrange = range(cells(2,"c"), cells(lastrow, "c"))
myrange.paste

the macro stops at the "myrange.paste"

Jack
 
J

Jim Cone

set myrange = Range(Cells(2,"c"), Cells(lastrow, "c"))
Range("E1").Copy myrange
--
Jim Cone
Portland, Oregon USA




"Jack" <[email protected]>
wrote in message
i'm trying to copy a formula from E1 to a range of cells in column c from row
2 to the lastrow in the column. Here is my code

Sub Test
dim lastrow
application.goto reference:="r65536c1"
selection.end(xlup).select
lastrow = activecell.row

range ("E1").select
selection.copy
set myrange = range(cells(2,"c"), cells(lastrow, "c"))
myrange.paste

the macro stops at the "myrange.paste"
Jack
 
J

Jack

Thanks that did the trick.

with this command i have pasted a formula into the range i would now like to
copy and paste back as a value. could you also help with that.

Jack
 
J

Jim Cone

Jack,
Range("E1").Value = myrange.Value
--
Jim Cone
Portland, Oregon USA



"Jack" <[email protected]>
wrote in message
Thanks that did the trick.
with this command i have pasted a formula into the range i would now like to
copy and paste back as a value. could you also help with that.
Jack
 
J

Jack

Jim

i'm sorry i wasn't clear

in e1 i have the formula =($a1&$b1) which was copied into
column c2 to c last row with the first code you provided
Now i want to change the formulas in c2 to c lastrow to values
 
J

Jim Cone

Jack,
And I was mixed up...
myrange.Value = myrange.Value
--
Jim Cone
Portland, Oregon USA




"Jack" <[email protected]>
wrote in message
Jim
i'm sorry i wasn't clear
in e1 i have the formula =($a1&$b1) which was copied into
column c2 to c last row with the first code you provided
Now i want to change the formulas in c2 to c lastrow to values
 
J

Jack

Jim
Thanks alot - this worked perfectly

Jim Cone said:
Jack,
And I was mixed up...
myrange.Value = myrange.Value
--
Jim Cone
Portland, Oregon USA




"Jack" <[email protected]>
wrote in message
Jim
i'm sorry i wasn't clear
in e1 i have the formula =($a1&$b1) which was copied into
column c2 to c last row with the first code you provided
Now i want to change the formulas in c2 to c lastrow to values
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top