jeannier1975
Computer
- Aug 14, 2019
- 3
I may be in the wrong place, excuse me if I am. I am creating a wonderware application and I need to create some reports. the reports are Emission tags. I enter the start date and end date on excel form and by using historian wonderware formula (= Sheet1!$A$1:$A$10,"Row7",AFStartBinding,AFEndBinding,254,0,0,0,0,3,0,"",3,"",-1,0,"","NoFilter",20480))
I want the user to click on a button and it inputs the emission tags into the next excel row.I have tried something like this (Sub Test1()
Dim strFunc As String
Dim lngLastRow As Long
strFunc = "= Sheet1!$A$17:$A$21,""Row7"",AFStartBinding,AFEndBinding,254,0,0,0,0,3,0,"",3,"""",-1,0,"""",""NoFilter"",20480)"
strFunc = "='strFunc = "SUM(B9:B10)"
Range("A21").Value = "ExtractDate"
Range("A22").Formula = strFunc
lngLastRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & lngLastRow + 1).Value = lngLastRow
Worksheets(1).Calculate
End Sub
Function As Date, dtEnd As Date)
= DateDiff("d", dtStart, dtEnd)
End Function
)
But when i run the data it enters just the date field and no emission tag values and deletes the formula in all the cells.Any guidance on the issue would be grateful
I want the user to click on a button and it inputs the emission tags into the next excel row.I have tried something like this (Sub Test1()
Dim strFunc As String
Dim lngLastRow As Long
strFunc = "= Sheet1!$A$17:$A$21,""Row7"",AFStartBinding,AFEndBinding,254,0,0,0,0,3,0,"",3,"""",-1,0,"""",""NoFilter"",20480)"
strFunc = "='strFunc = "SUM(B9:B10)"
Range("A21").Value = "ExtractDate"
Range("A22").Formula = strFunc
lngLastRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & lngLastRow + 1).Value = lngLastRow
Worksheets(1).Calculate
End Sub
Function As Date, dtEnd As Date)
= DateDiff("d", dtStart, dtEnd)
End Function
)
But when i run the data it enters just the date field and no emission tag values and deletes the formula in all the cells.Any guidance on the issue would be grateful