Solved

Loop through Excel cells in a named range

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel if statement 3 15
Excel formula with two ifs 9 27
MS Excel Multi Sheet Formula 13 31
excel conditional formating 4 14
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

808 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