?
Solved

Loop through Excel cells in a named range

Posted on 2010-09-22
3
Medium Priority
?
257 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 1000 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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

650 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