Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling in blank cells with information from cells above it tracytracy123 Excel Discussion (Misc queries) 1 June 22nd 09 11:04 PM
filling cells Art Excel Discussion (Misc queries) 0 November 30th 06 03:36 PM
use VB code IF to automate filling in 11 columns smart.daisy Excel Discussion (Misc queries) 1 May 29th 06 09:08 PM
Filling cells JohnS Excel Programming 2 September 30th 04 09:07 AM
Code for new row and specific filling down Lucy[_2_] Excel Programming 1 June 23rd 04 11:44 AM


All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"