Fill Data Series between multiple points, differing steps and gaps

gda_scooby

New Member
Joined
Mar 4, 2019
Messages
1
Afternoon, long time lurker, first time poster (Excel 2016 /Win 10 user)

I have successfully dabbled with various macros and tips from here, but I am now struggling with a seemingly simple task, but I'm not sure what to even search against.

I have a column of negative values, with 'gaps' between values.

The gaps are at different step values between cells, and the number of cells (ie the 'distance') between each value can differ (so can be 2 rows apart or up to 1000 rows apart)

Now I can manually select the range between the two cells and use HOME, FILL, SERIES - and it will automatically work out my step value (linear, columns) and fill that series successfully.

However I have a data set with approximately 12000 rows, and 100+ values to fill between.

How can I automate this?

[TABLE="width: 500"]
<tbody>[TR]
[TD]trigger flag[/TD]
[TD]raw value[/TD]
[TD]desired result[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]-29[/TD]
[TD]-29[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-30[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-31[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]-32[/TD]
[TD]-32[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-31.8[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-31.6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-31.4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]-31.2[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]-31[/TD]
[TD]-31[/TD]
[/TR]
</tbody>[/TABLE]


The cells in my column between values appear blank, but are not strictly blank - they are the result of a =IF command else where, returning a "" value, then copy/pasted as values into the column I want to fill. therefore I cannot use CTRL + Cursor down to jump the gaps. (I presume this is a secondary problem I have caused)

I have multiple spreadsheets to work on, so any time savings would be appreciated

Thanks in advance,

Gareth
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi & welcome to MrExcel.
How about
Code:
Sub gda_scooby()
   Dim Rng As Range
   With Range("B2", Range("B" & Rows.count).End(xlUp))
      .Value = .Value
      For Each Rng In .SpecialCells(xlBlanks).Areas
         Rng.Offset(-1).Resize(Rng.count + 2).DataSeries xlColumns, xlLinear, xlDay, , , True
      Next Rng
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top