Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have built a macro using the recording function. The programing wa intended to have cell B20 equal to cell B197. Here is the program Sub AZWage() ' ' AZWage Macro ' Macro recorded 8/19/2005 by Systems Administrator ' ' Range("G9:G13").Select Selection.Interior.ColorIndex = xlNone Range("G12").Select With Selection.Interior .ColorIndex = 41 .Pattern = xlSolid End With Range("B20").Select ActiveCell.FormulaR1C1 = "=R[177]C" Range("B21").Select ActiveCell.FormulaR1C1 = "=R[178]C" Range("B23").Select ActiveCell.FormulaR1C1 = "=R[173]C" Range("B24").Select ActiveCell.FormulaR1C1 = "=R[174]C" Range("B26").Select ActiveCell.FormulaR1C1 = "=R[169]C" Range("B27").Select ActiveCell.FormulaR1C1 = "=R[167]C" Range("B28").Select Range("C20").Select ActiveCell.FormulaR1C1 = "=R[177]C" Range("C21").Select ActiveCell.FormulaR1C1 = "=R[178]C" Range("C23").Select ActiveCell.FormulaR1C1 = "=R[173]C" Range("C24").Select ActiveCell.FormulaR1C1 = "=R[174]C" Range("C26").Select ActiveCell.FormulaR1C1 = "=R[169]C" Range("C27").Select ActiveCell.FormulaR1C1 = "=R[167]C" Range("C28").Select ActiveWindow.ScrollRow = 1 End Sub The problem with the prgram is that if you insert cells above B20 o between B20 and B197 then the everything gets goofed up. What can I d differently so that if the worksheet is modified it doesn't effect th macro. Thanks for the help. I need it as soon as possible. I am trying to hel the big boss out with this -- mgmcdevit ----------------------------------------------------------------------- mgmcdevitt's Profile: http://www.excelforum.com/member.php...fo&userid=2659 View this thread: http://www.excelforum.com/showthread.php?threadid=39860 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting function into worksheet via macro | Excel Discussion (Misc queries) | |||
Inserting same character into multiple cells--Macro? | Excel Discussion (Misc queries) | |||
Macro to copy cells from one worksheet to another | Excel Discussion (Misc queries) | |||
Inserting Comments into Cells of Protected Worksheet | Excel Worksheet Functions | |||
need a macro select all cells in a worksheet? | Excel Discussion (Misc queries) |