View Single Post
  #5   Report Post  
primeride2k primeride2k is offline
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Thu, 16 May 2013 20:32:15 +0100 schrieb primeride2k:

How would I set it up so I can use it as a template? I would like to
open the excel file, input the range and increments, then have it
generate the series on sheet 2 automatically. Also, if I change the
range and/or increment on sheet 1, I would like the series to change
accordingly on sheet 2 automatically.


right-click on tab of sheet1 = Show code = paste following code in the
code window:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A2,B1")) Is _
Nothing Then Exit Sub

With Sheets("Sheet2")
.Columns("A").ClearContents
.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
I am working on Excel for Mac 2011 version 14.1.0 and it does not give me an option for show code when I right click the sheet tab. Is there another place I can enter it? Thanks!