Help modify code

noelmus

Board Regular
Joined
Dec 30, 2018
Messages
105
Hi,
I have a worksheet showing 3 tanks where they have not the same capacity and by help I got a code (below). Current code shows that the 3 tanks have a capacity of 400000. My problem is that only Tank A has that capacity. Capacity of Tank B is 272000 and Tank C is 200000.
Will you please someone help me by modify the code below.
Thanks in advance
Code:
[COLOR=#000000][FONT='inherit']Option Explicit[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']Private Sub AdjustTank(ByVal CurLevel As Double, ByVal TankID As String, _[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    Optional MaxLevel As Double = 400000)[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Dim Tank As Shape, Frame As Shape, Level As Shape, Number As Shape[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'Refer to he Tank shape[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Set Tank = Me.Shapes("Tank" & TankID)[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'Refer to the shapes inside[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Set Frame = Tank.GroupItems("FrameA")[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Set Level = Tank.GroupItems("LevelA")[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Set Number = Tank.GroupItems("NumberA")[/FONT][/COLOR]

[COLOR=#000000][FONT='inherit']  'Be sure the new level is not above the max level[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  If CurLevel > MaxLevel Then CurLevel = MaxLevel[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'Write the new level number into the TextBox[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Number.TextFrame2.TextRange.Text = Format(CurLevel, "#,##0")[/FONT][/COLOR]

[COLOR=#000000][FONT='inherit']  'Calculate the height of the level according to the max. level[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Level.height = (Frame.height - 2) / MaxLevel * CurLevel[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'Move the level to the bottom[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Level.Top = Frame.Top + Frame.height - Level.height - 1[/FONT][/COLOR]

[COLOR=#000000][FONT='inherit']  'Move the number into the middle[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Number.Left = Frame.Left + Frame.Width / 2 - Number.Width / 2[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'And below the level line[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Number.Top = Level.Top - 3[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  'If the number is too low move it to the lowest possible position[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  If Number.Top + Number.height > Frame.Top + Frame.height Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    Number.Top = Level.Top - Number.height + 3[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  End If[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    If CurLevel < 80000 Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']       Level.Fill.ForeColor.RGB = RGB(255, 228, 225)[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    ElseIf CurLevel >= 80000 And CurLevel < 400000 Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']       Level.Fill.ForeColor.RGB = RGB(135, 206, 250)[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    Else[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        Level.Fill.ForeColor.RGB = RGB(152, 251, 152)[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    End If[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']End Sub[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']
[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']Private Sub Worksheet_Calculate()[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    Static LastValueU, LastValueS, LastValueA[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    Dim shp As Shape, height As Double[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    With Range("U25")[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        If LastValueU <> .Value Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            AdjustTank .Value, "A"[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            LastValueU = .Value[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        End If[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    End With[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    With Range("S25")[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        If LastValueS <> .Value Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            AdjustTank .Value, "B"[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            LastValueS = .Value[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        End If[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    End With[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    With Range("A29")[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        If LastValueA <> .Value Then[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            AdjustTank .Value, "C"[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']            LastValueA = .Value[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']        End If[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']    End With[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']End Sub[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']
[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']Sub test()[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Me.Shapes("BackGroundA").Left = Me.Shapes("FrameA").Left[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']  Me.Shapes("BackGroundA").Top = Me.Shapes("FrameA").Top[/FONT][/COLOR]
[COLOR=#000000][FONT='inherit']End Sub[/FONT][/COLOR]
 
Last edited by a moderator:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
[TABLE="width: 1246"]
<colgroup><col><col span="2"><col><col span="15"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]capacities[/TD]
[TD][/TD]
[TD]tank1[/TD]
[TD]tank2[/TD]
[TD]tank3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]OVERFLOW[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]ladst rownum[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]400000[/TD]
[TD="align: right"]272000[/TD]
[TD="align: right"]200000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]current levels[/TD]
[TD][/TD]
[TD="align: right"]211000[/TD]
[TD="align: right"]232000[/TD]
[TD="align: right"]155000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]click here to run macro[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]date[/TD]
[TD]addvol[/TD]
[TD]tankid[/TD]
[TD]ok to add[/TD]
[TD]rownum[/TD]
[TD][/TD]
[TD]helper[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"]35000[/TD]
[TD]tank2[/TD]
[TD]YES[/TD]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]02/01/2019[/TD]
[TD="align: right"]70000[/TD]
[TD]tank3[/TD]
[TD]NO[/TD]
[TD="align: right"]12[/TD]
[TD][/TD]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]this macro handles each potential top up[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]35000 was added to tank 2 correctly[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]but trying to add 70000 to tank 3 failed[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]zand the overflow signal appeared in L1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]Sub Macro4()[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]'[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]' Macro4 Macro[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]' Macro recorded 23/01/2019 by bob[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]'[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]'[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 6"] If Cells(Cells(3, 2), 4) = "YES" Then GoTo 100 Else GoTo 200[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 9"]100 Cells(7, Cells(Cells(3, 2), 7)) = Cells(7, Cells(Cells(3, 2), 7)) + Cells(Cells(3, 2), 2)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]GoTo 500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]200 Cells(1, 12) = "OVERFLOW"[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]500 End Sub[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]where it says click here to run macro[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 5"]put in a suitable shape and assign the macro to it[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi oldbrewer,
Thanks for your reply, but the tanks have a lot of information added to them such as add, subtract, gains and losses.
 
Upvote 0
ok - this approach tells you what is added - if you added a negative 5000 to tank 1 it would take 5000 off the current level - the whole table enables you to analyse data by date range - probably using a pivot table - you could make charts of each tank level over time - but good luck !
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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