Solved

Loop through Excel cells in a named range

Posted on 2010-09-22
3
249 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now