LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Resize Range & Fill Column with Formula - Help

Here is the code I have but am having problems with my loop for filling the
cells in the new range:

Sub AutoFillColE()
'
' AutoFillColE Macro
' Auto fill col E based upon length of Current Region
'
Dim rngCell As Range
Dim rngCurrent As Range
Dim shtFlagelNoB05 As Worksheet

Set shtFlagelNoB05 = Application.ActiveWorkbook.Worksheets("Flagel_ERP_ NoB05")
Set rngCurrent = shtFlagelNoB05.Range("A4").CurrentRegion
Set rngCurrent = rngCurrent.Offset(rowoffset:=1, columnoffset:=4)
Set rngCurrent = rngCurrent.Resize(RowSize:=rngCurrent, ColumnSize:=1)

'Paste formula in each cell in Column E from E5 down to bottom of new
range
For Each rngCell In rngCurrent
rngcell.Formula = "=IF(B4 <= TODAY()-77,"11+ Weeks",IF(B4 <=
TODAY()-42,"6 to 10 Weeks",IF(B4 <= TODAY()-7,"1 to 5 Weeks",IF(B4
TODAY()-7,"Current Week"))))"
Next rngCell

End Sub
 
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
Resize Chart to fit picture fill Excel 2007 Ted M H Charts and Charting in Excel 1 June 10th 08 08:34 PM
how do I resize a range of cells in a column in excel? Terri Excel Discussion (Misc queries) 6 December 20th 06 06:57 PM
Resize Last Row to Fill a Page Width Sloth Excel Discussion (Misc queries) 0 February 17th 06 10:28 PM
Getting Range to move 1 column left and resize by 1 mozart[_4_] Excel Programming 1 August 24th 05 08:39 AM
How to fill range with formula using VBA? deko[_2_] Excel Programming 7 March 16th 05 01:17 AM


All times are GMT +1. The time now is 06:49 AM.

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

About Us

"It's about Microsoft Excel"