X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Subtration Date Using Vba, Office 2013    
post Apr 27 2019, 03:42 AM

Posts: 514
Joined: 11-July 09

Hello all,

I have a columnA with a Long serie number and a columnC with date. I would like when columnA if Row for example A3 & A4 has the same serie number, so this will make a subtraction and the result put in column H same row. Below I have a small macro but it did not work.

I am appreciated for any help.

Dim i As Integer, Result As String, Cell As String, ShtRaw As Worksheet

Dim dTheDate As Date

dTheDate = #10.12.2012#

Range("C1:C500").Value = dTheDate

Set ShtRaw = Sheets("Labo")

For i = 1 To 5000

Cell = Cells(i, 1).Value

If ShtRaw.Cells(i, 1) = ShtRaw.Cells(i - 1, 1) Then

dTheDate = Cells(i, 3) - Cells(i, 3)

End If

Cells(i, 8) = dTheDate

Next i

Thanks for all.

Attached File(s)
Attached File  Date.png ( 124.65K )Number of downloads: 1
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    6th August 2020 - 04:47 PM