I may be in the wrong place, excuse
I may be in the wrong place, excuse
(OP)
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 (=wwWideHistory3("LEWC2012INSQL", 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 = "=wwWideHistory3(""LEWC2012INSQL"", Sheet1!$A$17:$A$21,""Row7"",AFStartBinding,AFEndBinding,254,0,0,0,0,3,0,"",3,"""",-1,0,"""",""NoFilter"",20480)"
strFunc = "=wwWideHistory3(AFStartBinding,AFEndBinding)"
'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 wwWideHistory3(dtStart As Date, dtEnd As Date)
wwWideHistory3 = 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 = "=wwWideHistory3(""LEWC2012INSQL"", Sheet1!$A$17:$A$21,""Row7"",AFStartBinding,AFEndBinding,254,0,0,0,0,3,0,"",3,"""",-1,0,"""",""NoFilter"",20480)"
strFunc = "=wwWideHistory3(AFStartBinding,AFEndBinding)"
'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 wwWideHistory3(dtStart As Date, dtEnd As Date)
wwWideHistory3 = 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
RE: I may be in the wrong place, excuse
You never responded to my response in Tek-Tips.
I notice that you also failed to correct one of your function arguments.
Skip,
for a NUance!
RE: I may be in the wrong place, excuse
RE: I may be in the wrong place, excuse
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: I may be in the wrong place, excuse
TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm