Hello Again Mr and Mrs Excel,
I had columns with Headings:
Local Date, Local Time, UTC Date and UTC Time and a lot more columns to the right which I am not really concerned about.
With a command button pressed, all the columns in a single row are filled from corresponding Textboxes in Userform1.
Here is a code that I worked with:
Any idea on how to subtract or add hours to current Date and Time?
I had columns with Headings:
Local Date, Local Time, UTC Date and UTC Time and a lot more columns to the right which I am not really concerned about.
With a command button pressed, all the columns in a single row are filled from corresponding Textboxes in Userform1.
Here is a code that I worked with:
Code:
With ActiveCell '(LastRow in column A) which get it value from a combobox e.g = 06/07/17 (dd/mm/yyyy)
.Offset(0,1) = TextBox1.Value
.Offset(0,2) = TextBox2.Value
.Offset(0,3) = ActiveCell - 14 hours 'My Local Date is +14 hrs to UTC Date so I want to subtract to get UTC
.Offset(0,4) = ActiveCell.Offset(0,1) - 14 hours 'In this section I want to get a UTC Time
Any idea on how to subtract or add hours to current Date and Time?