Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code Correction
Hi All, thanks a million in advance!
my Current code is: Range ("B9").Select Dim i As Integer For i = 4 to 7 ActiveCell.FormulaR1C1 = "R[-i]C[4]" Next i End Sub This does not work. Im trying to set cell B9= to A6 (in this example), then repeat the code with i=5 meaning B9 should now = A5 (in this example). Could anyone help please. Thanks Rich |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code Correction
Without asking what this code is supposed to do <g :
Range ("B9").FormulaR1C1 = "R[-" & i & "]C[4]" Try to avoid Select unless you really need to guide the user around. HTH. Best wishes Harald "RichIT" skrev i melding ps.com... Hi All, thanks a million in advance! my Current code is: Range ("B9").Select Dim i As Integer For i = 4 to 7 ActiveCell.FormulaR1C1 = "R[-i]C[4]" Next i End Sub This does not work. Im trying to set cell B9= to A6 (in this example), then repeat the code with i=5 meaning B9 should now = A5 (in this example). Could anyone help please. Thanks Rich |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code Correction
Sub Dosomething()
Range ("B9").Select Dim i As Integer For i = 4 to 7 ActiveCell.FormulaR1C1 = "R[" & -i & "]C[-1]" Msgbox Activecell.formula Next i End Sub -- Regards, Tom Ogilvy "RichIT" wrote: Hi All, thanks a million in advance! my Current code is: Range ("B9").Select Dim i As Integer For i = 4 to 7 ActiveCell.FormulaR1C1 = "R[-i]C[4]" Next i End Sub This does not work. Im trying to set cell B9= to A6 (in this example), then repeat the code with i=5 meaning B9 should now = A5 (in this example). Could anyone help please. Thanks Rich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Correction | Excel Worksheet Functions | |||
Value correction | Excel Discussion (Misc queries) | |||
Code Correction Need | Excel Programming | |||
correction to the question | Excel Programming | |||
correction | Excel Discussion (Misc queries) |