Simple VBA - Divide E6 to E20 by 1000

Hi,

Simple VBA from a beginner.

How do I loop thru cells E6 to E20 and divide each cell by 1000

Thanks
Patrick O'DeaAsked:
Who is Participating?
 
patrickabConnect With a Mentor Commented:
Sub divi()
Dim i As Long

For i = 6 To 20
    Cells(i, "E") = Cells(i, "E") / 1000
Next i

End Sub
0
 
gbanikConnect With a Mentor Commented:
There is a direct solution without a VBA.

Type 1000 in A1 (assuming it is empty). Select A1 and hit CNTRL + C (copy it). Now select range E6 to E20. Right click and Paste special. In the options, Select Divide in "Operation". Enjoy!!
0
 
patrickabCommented:
I tend to forget that option, but then 21Dewsbury did imply a VBA solution was required.
0
 
Patrick O'DeaAuthor Commented:
Thanks all.
0
 
patrickabCommented:
21Dewsbury - Thanks for the grade & points - Patrick
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.