So I have a table like this, assume Tidal Height is B1:
Tidal Time Tidal Height
00:00:00 4.40
01:00:00
02:00:00
03:00:00
04:00:00
05:00:00
06:00:00 2.00
07:00:00 2.50
08:00:00 3.00
09:00:00 3.50
10:00:00 4.00
11:00:00 4.50
12:00:00
13:00:00
14:00:00
15:00:00
16:00:00
17:00:00
18:00:00 2.10
19:00:00 2.56
20:00:00 3.02
21:00:00 3.48
22:00:00 3.94
23:00:00 4.40
So I need to do this:
1st Step: Select the first occupied cell from B2, and select up till (and including) the next occupied cell. Then run this code:
RangeToFill.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, Trend:=True
2nd Step: Deselect, then continue and select the cell before the next empty cell. Select up till (and including) the next occupied cell. Then run the trend code above.
I can do this by hand, but i'm unsure how to automate the process like this to take in account the changing data sets in different positions. Any help would be appreciated please!
RangeToFill.DataSerieswhich is already there. - GSergRange.End(xlDown)method to get each set of data. However, as can be seen in your example data, you'll need to a check first if B3 is empty, since if you use theRange.End(xlDown)method, you will get the wrong range. - Scott HoltzmanRange.End(x1Down)also doesn't fulfil this requirement - Savagefool