Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default range select not working with small sets

I am using coding to automate some charts. It works great unless my data set
has fewer than 25 lines. When the data set is small (<25 rows) the code
interrupts. Debugging takes me to:
ActiveCell.FormulaR1C1 = "=average(RC2:r[-" & mysmooth - 1 & "]c2)"

the section of coding that this applies to is:
'determine smoothing

Range("f20").Select
ActiveCell.Formula = "=LOOKUP(" & numberrows & ",'[Trending Source
rework 2.xls]Stats'!R1C1:R5C1,'[Trending Source rework
2.xls]Stats'!R1C2:R5C2)"
mysmooth = ActiveCell.Value

Range("F21").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(""PI Smoothing ("",smooth,""
Point)"")"
Range("h" & mysmooth + 2).Select
ActiveCell.FormulaR1C1 = "=average(RC2:r[-" & mysmooth - 1 & "]c2)"
Selection.AutoFill Destination:=Range("h" & mysmooth + 2 & ":h" &
numberrows), Type:=xlFillDefault
Columns("h").EntireColumn.AutoFit

The table on the STATs sheet is in A1:b5
0 0
25 4
50 6
150 12
250 18

Anything over 25 rows it works fine.

Any ideas?
TIA
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
Using SMALL Function with select data thscc1659 Excel Worksheet Functions 6 September 18th 08 07:48 AM
Working with Sets ?? Jay Somerset Excel Discussion (Misc queries) 0 November 30th 05 04:29 AM
Working with Sets Jay Somerset Excel Discussion (Misc queries) 0 November 24th 05 11:57 PM
Select Range - using Offset ( 40 ,0 ) - not working Buffyslay Excel Programming 4 October 8th 04 11:35 AM
Range().Select Not Working Chip Pearson Excel Programming 1 December 12th 03 02:21 PM


All times are GMT +1. The time now is 03:21 PM.

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"