Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling cells via code..
Hi
I need to run code that finds all the worksheets in my activeworkbook that have the name "AC Planned Summary" (there could be many with (2) (3) and so on after the name ) and determines if cells C9:C100 are greater than or equal to 0. If C9:C100 have any values greater than or equal to 0, then the corresponding cells in E9:E100 need to have a 0 placed in them via this code. SO if .. C9 , C10 and C11 all have values greater or equal to zero in them..then I would need E9, E10 and E11 to have 0 placed into those cells via this code. I would use formulas.. but I need to determine the last entry in that column..and formulas mess that up.. Thanks in advance for your help!! Kimberly |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling cells via code..
Have a hybrid. Create a macro that will insert your IF formula in the
desired range. To determine the range, use something similar to: LastRow = Range("C65536").End(xlup).row Range("e9:e" & LastRow).Formula = "=IF(C9=0,0,"""")" You can use a loop to find all of the summary sheets. Something similar to: for i = 1 to sheets.count if left(sheets(i).name,3) = "AC " then LastRow = Range("C65536").End(xlup).row Range("e9:e" & LastRow).Formula = "=IF(C9=0,0,"""")" end if next -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "KimberlyC" wrote in message ... Hi I need to run code that finds all the worksheets in my activeworkbook that have the name "AC Planned Summary" (there could be many with (2) (3) and so on after the name ) and determines if cells C9:C100 are greater than or equal to 0. If C9:C100 have any values greater than or equal to 0, then the corresponding cells in E9:E100 need to have a 0 placed in them via this code. SO if .. C9 , C10 and C11 all have values greater or equal to zero in them..then I would need E9, E10 and E11 to have 0 placed into those cells via this code. I would use formulas.. but I need to determine the last entry in that column..and formulas mess that up.. Thanks in advance for your help!! Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filling in blank cells with information from cells above it | Excel Discussion (Misc queries) | |||
filling cells | Excel Discussion (Misc queries) | |||
use VB code IF to automate filling in 11 columns | Excel Discussion (Misc queries) | |||
Filling cells | Excel Programming | |||
Code for new row and specific filling down | Excel Programming |