Solved

Loop through Excel cells in a named range

Posted on 2010-09-22
3
253 Views
Last Modified: 2012-05-10
I have a large spreadsheet in Excel that I need to clean the data.  I want to move through every cell in a named range and perform and action based on the value in that cell.  If the value is >70 I want to replace it with "Complete", if it is <69 I want to replace it with "Incomplete".  Can someone help me loop this within a named range (range name "FIXTHIS").
0
Comment
Question by:marku24
[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
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
spattewar earned 250 total points
ID: 33737955
you can use the following codeFor Each rngCell in ActiveSheet.Range("FIXTHIS")     If rngCell.value > 70 then          rngCell.value = "Complete"     ElseIf rngCell.value < 69 then          rngCell.value = "Incomplete"     End IfNextHope this helps
0
 

Author Comment

by:marku24
ID: 33738087
is rngCell a variable?
0
 

Author Comment

by:marku24
ID: 33738157
Had to declare it as a range.  Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

730 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