Hi guys, I need help. I want to update my final report with the help of macro from the attached data to save my time. Actually I have to update this sheet consistently and manually it costs a lot of my time. Anybody who's there to help will be highly appreciated. Below is my attached VBA code...
Sub SubtractDate()
Dim LastRow As Long, i As Long
Dim myValue As Variant
myValue = InputBox("Subtraction of Days")
With Worksheets("Pre Data")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For i = 2 To LastRow
.Range("A" & i).Value = -myValue
Next i
End With
End Sub
my date format is HH:mm:ss
When user presses a button it'll ask how many days you wanna subtract. In the output that particular number subtract from date, which is present in column A2. Please help me out to correct above code.
Sub SubtractDate()
Dim LastRow As Long, i As Long
Dim myValue As Variant
myValue = InputBox("Subtraction of Days")
With Worksheets("Pre Data")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For i = 2 To LastRow
.Range("A" & i).Value = -myValue
Next i
End With
End Sub
my date format is HH:mm:ss
When user presses a button it'll ask how many days you wanna subtract. In the output that particular number subtract from date, which is present in column A2. Please help me out to correct above code.