WaterSprite
Technical User
Dim x As Date, xx As Integer, thisTime As Date,Date1 As Date
Dim y As Date, z As Integer, a As Integer, b As Integer, bb As Integer, aa As Integer
With Activesheet
Cells.Clear
aa = 10
bb = 9
b = 384
Date1 = Format$(Date, "dd-mmm-yyyy hh:mm")
Cells(9, 1).Value = Date1
thisTime = #12:15:00 AM#
xx = Minute(thisTime)
Cells(6, 1).Value = xx
ActiveWorkbook.Names.Add Name:=("PB9"), _
RefersToR1C1:="=" & "!R" & aa & "C1:R" & b & "C1"
Range("PB9").FormulaR1C1 = "=(R[-1]C1) + (15/1440)"
Range("PB9").NumberFormat = "dd-mmm-yyyy hh:mm"
End With
*********************************
This code, as you see it, works. What I want to do, and have spent almost two days trying to do,
is set the (15/1440) in this line [Range("PB9").FormulaR1C1 = "=(R[-1]C1) + (15/1440)"]
to a variable, thus the xx in the body of the code. But, nothing I do works.