Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

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
Copying Cells Paul Excel Discussion (Misc queries) 2 February 11th 07 12:38 AM
Copying Cells LauraC Excel Worksheet Functions 2 March 29th 06 03:38 PM
copying cells by checking color of the cells JJJ010101 Excel Programming 1 January 24th 06 06:42 AM
How do I skip blank cells when copying over a range of cells? tawells Excel Discussion (Misc queries) 2 June 7th 05 09:36 PM
Excel should allow cloaking of certain cells when copying cells b. LDI Woody Excel Worksheet Functions 1 March 11th 05 04:55 PM


All times are GMT +1. The time now is 09:18 PM.

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

About Us

"It's about Microsoft Excel"