Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Automating Fill series Function Multiple times ?

I hope someone can help me out.
I have a column of data with blank gaps for example somthing like the
following

15
46
55

32
21


48
59

I can manual select the value before the gaps/blank cells to the value after
the gaps so that they are highlighted and just do a Fill series function and
excel atuomaticly will interpolate values for the gaps. However I have a
rather large data set with lots of gaps and it is not very practical to do
this manualy for each gap in the column of data. I am have been trying to get
excell to automaticly do this for all the gaps, however have not found a
method to do this.

Any suggestions or help ?

Dan.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Automating Fill series Function Multiple times ?

Hi Dan;

You can use a sub like this


sub try()

'Grab the address for where I am
'this should be the top cell of the column
'you want to select

CellToReturnTo = ActiveCell.Address

Range("A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
MyLastRow = ActiveCell.Row

Range(CellToReturnTo).Select

Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells
(MyLastRow, ActiveCell.Column)).Select

End Sub


Thanks,

Greg


-----Original Message-----
I hope someone can help me out.
I have a column of data with blank gaps for example

somthing like the
following

15
46
55

32
21


48
59

I can manual select the value before the gaps/blank cells

to the value after
the gaps so that they are highlighted and just do a Fill

series function and
excel atuomaticly will interpolate values for the gaps.

However I have a
rather large data set with lots of gaps and it is not

very practical to do
this manualy for each gap in the column of data. I am

have been trying to get
excell to automaticly do this for all the gaps, however

have not found a
method to do this.

Any suggestions or help ?

Dan.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Automating Fill series Function Multiple times ?

I appreciate your input and help but that is not quite what I was after.
here is what the code looks like when I preformed the oporation on 3 gaps
and recorded the macro.

Sub Macro1()
Selection.End(xlDown).Select
Range("B25:B27").Select
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=-0.959999999999997, Trend:=False
Selection.End(xlDown).Select
Range("B66:B68").Select
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=0.315000000000001, Trend:=False
Selection.End(xlDown).Select
Range("B96:B98").Select
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=-0.515000000000001, Trend:=False
End Sub

I need a way to automate this type of procedure. Somthing that will find the
gaps then interpolate values for gaps between the value just before the gap
and the value just after the gap and than continue finding and intorpolating
this process for the rest of the gaps.....?


"GJones" wrote:

Hi Dan;

You can use a sub like this


sub try()

'Grab the address for where I am
'this should be the top cell of the column
'you want to select

CellToReturnTo = ActiveCell.Address

Range("A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
MyLastRow = ActiveCell.Row

Range(CellToReturnTo).Select

Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells
(MyLastRow, ActiveCell.Column)).Select

End Sub


Thanks,

Greg


-----Original Message-----
I hope someone can help me out.
I have a column of data with blank gaps for example

somthing like the
following

15
46
55

32
21


48
59

I can manual select the value before the gaps/blank cells

to the value after
the gaps so that they are highlighted and just do a Fill

series function and
excel atuomaticly will interpolate values for the gaps.

However I have a
rather large data set with lots of gaps and it is not

very practical to do
this manualy for each gap in the column of data. I am

have been trying to get
excell to automaticly do this for all the gaps, however

have not found a
method to do this.

Any suggestions or help ?

Dan.
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Automating Fill series Function Multiple times ?

But I don't think you gave enough information on how you fill the series.

If I just use the linear fill based on the top cell and bottom cell, then this
worked ok for me:

Option Explicit
Sub testme()
Dim myRng As Range
Dim myCell As Range
Dim myArea As Range
Dim myExtendedArea As Range

With Worksheets("sheet1")
Set myRng = Nothing
On Error Resume Next
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp)) _
.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "no gaps!"
Exit Sub
End If

For Each myArea In myRng.Areas
With myArea
Set myExtendedArea = .Cells(1).Offset(-1, 0) _
.Resize(.Cells.Count + 2)
End With
With myExtendedArea
.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=((.Cells(.Cells.Count).Value - .Cells(1).Value) _
/ (.Cells.Count - 1)), _
Trend:=False
End With
Next myArea
End With

End Sub


Dan Thompson wrote:

I hope someone can help me out.
I have a column of data with blank gaps for example somthing like the
following

15
46
55

32
21

48
59

I can manual select the value before the gaps/blank cells to the value after
the gaps so that they are highlighted and just do a Fill series function and
excel atuomaticly will interpolate values for the gaps. However I have a
rather large data set with lots of gaps and it is not very practical to do
this manualy for each gap in the column of data. I am have been trying to get
excell to automaticly do this for all the gaps, however have not found a
method to do this.

Any suggestions or help ?

Dan.


--

Dave Peterson

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
Fill Series function question Petert Excel Worksheet Functions 1 May 6th 09 01:01 PM
fill series of multiple rows and columns jas Excel Discussion (Misc queries) 4 July 30th 08 03:50 AM
Fill Series Dates: not letting me change the series from year to m Mike Excel Discussion (Misc queries) 1 January 24th 08 05:08 PM
Automating a series of dates for two columns? valholler Excel Worksheet Functions 0 September 28th 06 09:17 PM
Upper / Fill Series Function in Excel Shohoku79 Excel Discussion (Misc queries) 7 September 5th 06 10:38 PM


All times are GMT +1. The time now is 02:23 PM.

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"