Adjust "time" column when modifying row

redkulat

New Member
Joined
Apr 8, 2018
Messages
1
Hi everyone,

Is there a forumla to automatically adjust the "time" in a column when any specific row is modified? For example:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Time[/TD]
[TD]Subject[/TD]
[/TR]
[TR]
[TD]7:00 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7:30 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8:00 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8:15 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9:00 am[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


If I were to modify "7:00 am" by 15 minutes to "7:15 am", I would want all the other rows to automatically adjust time by 15 minute like so:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Time[/TD]
[TD]Subject[/TD]
[/TR]
[TR]
[TD]7:15 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7:45 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8:15 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8:30 am[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9:15 am[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I am hoping it's simpler than I thought. Any help guiding me in the direction would be super helpful, thank you!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Assuming your data is in Column A. In cell D2, put 0:15 and format it as date h:mm then this vba code should advance it by 15 minutes. Change Cell D2 as needed.

Code:
Option Explicit


Sub AdjTime()
    Dim i As Long, lr As Long
    Dim chg As Date
    chg = Range("D2")
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        Range("A" & i) = Range("A" & i) + chg
    Next i


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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