ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying cells (https://www.excelbanter.com/excel-programming/393283-copying-cells.html)

bilbo+

copying cells
 
Hi there, I've created a macro at the top of a page that inserts two rows and
copys some text from above, to create another 'entry' but ive also done this
further down but after ive run the top one it then puts the bottom one out of
sync, is there any way of making a macro relative to a certain cell or
relative to the button that runs it? or any solution will do... i just need
to be able to replicate bits of text to create room for more entries at
different stage down the page, help much appreciated¬!
thanks
Will

Tom Ogilvy

copying cells
 
cells(rows.count,"A").End(xlup).offset(1,0)

will be the next empty cell in column A coming up from the bottom. Adapt to
your situation.

--
Regards,
Tom Ogilvy


"bilbo+" wrote:

Hi there, I've created a macro at the top of a page that inserts two rows and
copys some text from above, to create another 'entry' but ive also done this
further down but after ive run the top one it then puts the bottom one out of
sync, is there any way of making a macro relative to a certain cell or
relative to the button that runs it? or any solution will do... i just need
to be able to replicate bits of text to create room for more entries at
different stage down the page, help much appreciated¬!
thanks
Will


bilbo+

copying cells
 
I'm kind of new to this so if you could just lend a little more of a hand!
basically for example, this is on rows 14 to 18. and i would want to create
another entry for this date so there are three instead of two. so what i did
was just insert two rows copy and paste (as a macro) then ran it, but as
mentioned before that put it all out of sync when i did that to another
further down. the macro read like this
Rows("16:16").Select
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Range("C13:J13").Select
Selection.Copy Destination:=Range("C16:J16")
Range("C16:J16").Select
Using that code just insert two rows in that column, when i need it the
entire row, i could just be being really stupid...
so how do i change it to do what I need? sorry i know im asking a lot but
any help would be hugely grarteful!


Number Of Terminals (n) 0 QW= 8.5 0

Number Of Terminals (n) 0 QW= 8.5 0



"Tom Ogilvy" wrote:

cells(rows.count,"A").End(xlup).offset(1,0)

will be the next empty cell in column A coming up from the bottom. Adapt to
your situation.

--
Regards,
Tom Ogilvy


"bilbo+" wrote:

Hi there, I've created a macro at the top of a page that inserts two rows and
copys some text from above, to create another 'entry' but ive also done this
further down but after ive run the top one it then puts the bottom one out of
sync, is there any way of making a macro relative to a certain cell or
relative to the button that runs it? or any solution will do... i just need
to be able to replicate bits of text to create room for more entries at
different stage down the page, help much appreciated¬!
thanks
Will


Tom Ogilvy

copying cells
 
insert your rows coming up from the bottom.

for example, process row 20, then 15, then 10

this way, your references don't move.

--
Regards,
Tom Ogilvy


"bilbo+" wrote:

I'm kind of new to this so if you could just lend a little more of a hand!
basically for example, this is on rows 14 to 18. and i would want to create
another entry for this date so there are three instead of two. so what i did
was just insert two rows copy and paste (as a macro) then ran it, but as
mentioned before that put it all out of sync when i did that to another
further down. the macro read like this
Rows("16:16").Select
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Range("C13:J13").Select
Selection.Copy Destination:=Range("C16:J16")
Range("C16:J16").Select
Using that code just insert two rows in that column, when i need it the
entire row, i could just be being really stupid...
so how do i change it to do what I need? sorry i know im asking a lot but
any help would be hugely grarteful!


Number Of Terminals (n) 0 QW= 8.5 0

Number Of Terminals (n) 0 QW= 8.5 0



"Tom Ogilvy" wrote:

cells(rows.count,"A").End(xlup).offset(1,0)

will be the next empty cell in column A coming up from the bottom. Adapt to
your situation.

--
Regards,
Tom Ogilvy


"bilbo+" wrote:

Hi there, I've created a macro at the top of a page that inserts two rows and
copys some text from above, to create another 'entry' but ive also done this
further down but after ive run the top one it then puts the bottom one out of
sync, is there any way of making a macro relative to a certain cell or
relative to the button that runs it? or any solution will do... i just need
to be able to replicate bits of text to create room for more entries at
different stage down the page, help much appreciated¬!
thanks
Will



All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com