Solved

Simple VBA - Divide E6 to E20 by 1000

Posted on 2010-11-10
5
597 Views
Last Modified: 2012-06-22
Hi,

Simple VBA from a beginner.

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

Thanks
0
Comment
Question by:Patrick O'Dea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 45

Accepted Solution

by:
patrickab earned 400 total points
ID: 34104605
Sub divi()
Dim i As Long

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

End Sub
0
 
LVL 13

Assisted Solution

by:gbanik
gbanik earned 100 total points
ID: 34104711
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
 
LVL 45

Expert Comment

by:patrickab
ID: 34104743
I tend to forget that option, but then 21Dewsbury did imply a VBA solution was required.
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 34105416
Thanks all.
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34105624
21Dewsbury - Thanks for the grade & points - Patrick
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question