View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Generate series according to range and increment

Hi,

Am Thu, 16 May 2013 18:21:31 +0100 schrieb primeride2k:

I am working with a two page workbook. On page one I have upper and
lower values of a range (example 0.0 to 5.0, or 0 to 100) and an
increment value (example 0.2 or 5). On page two I would like a column to
automatically fill with the series of values within the range according
to the increment value.


Start value in Sheet1 A1, stopp value in A2, increment in B1:

Sub FillLinear()
With Sheets("Sheet2")
.Range("A1") = Sheets("Sheet1").Range("A1")
.Range("A1").DataSeries Rowcol:=xlColumns, Type:=xlLinear, _
Step:=Sheets("Sheet1").Range("B1"), _
Stop:=Sheets("Sheet1").Range("A2")
End With
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2