Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Macro to shift

Is there any way to to change this macro so that every time it is run the row
is changed? Here is the macro:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[3]C"
Range("E4").Select
ActiveCell.FormulaR1C1 = "='Riverview East Owners'!R[0]C[-1]"
Range("E5").Select
ActiveCell.FormulaR1C1 = "='Liberty House Condominium'!R[-1]C[-1]"
Range("E6").Select

I want to tweak it so that when it is run the product would look like this
If I were to write the macro to illustrate the change:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[4]C"
Range("E4").Select
ActiveCell.FormulaR1C1 = "='Riverview East Owners'!R[1]C[-1]"
Range("E5").Select
ActiveCell.FormulaR1C1 = "='Liberty House Condominium'!R[0]C[-1]"
Range("E6").Select

And then the next time it is run the product would look like this (As if the
macro was written this way)

Range("C1").Select
ActiveCell.FormulaR1C1 = "=Master!R[5]C"
Range("E4").Select
ActiveCell.FormulaR1C1 = "='Riverview East Owners'!R[2]C[-1]"
Range("E5").Select
ActiveCell.FormulaR1C1 = "='Liberty House Condominium'!R[1]C[-1]"
Range("E6").Select

I dont want to have to physically change the row numbers in the macro
everytime it is run. I want it to do it on its own. Can anyone help?
 
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 to shift to next row Unique713 Excel Worksheet Functions 2 November 25th 08 05:51 PM
HELP: Setting CNTL-SHIFT-F to invoke Excel2007 macro Jay Somerset Excel Discussion (Misc queries) 7 June 3rd 07 09:40 PM
help with VB/Macro to shift cells [email protected] Excel Discussion (Misc queries) 3 May 3rd 06 08:03 PM
help with VB/Macro to shift cells dan Excel Discussion (Misc queries) 0 May 3rd 06 07:55 PM
how to use shift and down arrow keys in a macro? John W Excel Worksheet Functions 1 July 31st 05 01:21 AM


All times are GMT +1. The time now is 05:00 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"