View Single Post
 
Old 12-06-2011, 07:54 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default How to use for loop in formula in VBA?

Code:
With Application.Worksheets("ClassroomSittingPlan")

For x = 1 To 3
''''''''''''''''''''''''''''''''''''
.Cells(x, 1).Formula = "=Sum(B"&x&":C"&x&")"
''''''''''''''''''''''''''''''''''''
Next x

End With
In the Sum formula, how can I use the for loop variable in the formula?
Reply With Quote