Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
Hello,
How do you change this line to become For Each c in the range of B2 to B12 that is Not Blank? For Each c In Sheets("Inventory").Range("B2:B12") :) Aria *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
Code: -------------------- For Each c In Sheets("Inventory").Range("B2:B12") If c.value < "" Then -your code here- End if Next c -------------------- -- Excelenator ------------------------------------------------------------------------ Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768 View this thread: http://www.excelforum.com/showthread...hreadid=572257 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
How about just ignore the blanks, but still loop through them:
for each c in sheets("inventory").range("B2:B12").cells if c.value = "" then 'do nothing, skip it else 'do the real work here end if next c Aria wrote: Hello, How do you change this line to become For Each c in the range of B2 to B12 that is Not Blank? For Each c In Sheets("Inventory").Range("B2:B12") :) Aria *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
If you know that they are constants (but not "" - those aren't actually blank), you could use:
For Each c In Sheets("Inventory").Range("B2:B12").SpecialCells(x lCellTypeConstants,23) Or if they are all formulas (but not formulas that return "" - those also aren't actually blank): For Each c In Sheets("Inventory").Range("B2:B12").SpecialCells(x lCellTypeFormulas,23) HTH, Bernie MS Excel MVP <Aria wrote in message ... Hello, How do you change this line to become For Each c in the range of B2 to B12 that is Not Blank? For Each c In Sheets("Inventory").Range("B2:B12") :) Aria *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
Thanks Excelenator, that's exactly what I needed. Thanks to Dave also.
How do you set another condition that for each d in C2 to C12 that matches to $A$1, then afterwards trigger this code? For Each c In Sheets("Inventory").Range("B2:B12") If c.value < "" Then -your code here- End if Next c :) Aria *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
Something like this??? Code: -------------------- For Each d in Sheets("Inventory").Range("C2:C12") IF d.value = Range("A1").Value Then For Each c In Sheets("Inventory").Range("B2:B12") If c.value < "" Then -your code here- End if Next c Next d -------------------- -- Excelenator ------------------------------------------------------------------------ Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768 View this thread: http://www.excelforum.com/showthread...hreadid=572257 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
For each....that is not blank
Yes, thank-you Excelenator! That's exactly what I needed.
:) Aria *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Index/match - make blank cells return a blank value. | Excel Worksheet Functions | |||
Excel 2002: Return blank when VLOOKUP on blank cells | Excel Discussion (Misc queries) | |||
Average Formula to display blank cell if named range is blank | Excel Worksheet Functions | |||
Macro code to test for blank row and insert blank row if false | Excel Programming | |||
Copying and pasting a worksheet to a blank and removing blank rows | Excel Programming |