LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I make an absolute ref in a macro able to loop?

Hi,

I've written a macro that starts in row 6 in my spreadsheet. It:

1) Inserts 3 new rows
2) Copies cells A6 - O6 and pastes them in the three new rows
3) Copies the data in R6 and S6 and pastes it in P7 and Q7
4) Copies the data in T6 and U6 and pastes it in P8 and Q8
5) Copies the data in V6 and W6 and pastes it in P9 and Q9

I'd now like to make this macro loop through my whole spreadsheet until it
gets to a blank row, but I haven't been able to. I've tried a do loop but
keep getting errors. I think my main problem is trying to replace my
absolute references with variables. Can anyone help me?

This is the macro as it stands

Rows("7:9").Select
Selection.Insert Shift:=xlDown
Range("A6:O6").Select
Selection.Copy
Range("A7:A9").Select
ActiveSheet.Paste
Range("R6:S6").Select
Selection.Copy
Range("P7").Select
ActiveSheet.Paste
Range("T6:U6").Select
Selection.Copy
Range("P8").Select
ActiveSheet.Paste
Range("V6:W6").Select
Selection.Copy
Range("P9").Select
ActiveSheet.Paste

Thanks for your help!

Kat

 
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
How to make columns absolute Ollie4 Excel Discussion (Misc queries) 2 February 6th 08 06:55 PM
Can you make a range absolute? Danielle Excel Discussion (Misc queries) 3 November 28th 07 11:08 PM
Can't make loop macro work - help? [email protected] Excel Programming 1 October 11th 06 03:23 PM
how do i make a cell absolute Carly Aspden Excel Discussion (Misc queries) 5 August 29th 06 09:15 AM
Help with macro to make it loop through coloums R Krishna Excel Programming 0 July 29th 03 04:54 PM


All times are GMT +1. The time now is 07:21 AM.

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"