Solved

Loop through Excel cells in a named range

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
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…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

777 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