View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] carey.declan@gmail.com is offline
external usenet poster
 
Posts: 1
Default looping to through rows

i am writing a code to output data from a database called PHD to a
sheet called PI_PHD. when you select a range of tags to output from
the values are output across the columns instead of being output down
in rows. this cannot be helped. the way around is to repeat the
database call for each different tag. the code is as follows:

Sub GetData()

Dim StartTime, EndTime, TimeIncrement, TagList, TEMP1, TEMP1_1, TEMP2,
Dim TEMP3

StartTime = "PI_PHD!$B$1,"
EndTime = "PI_PHD!$B$2,"
TimeIncrement = "PI_PHD!$B$3"
TagList = "PI_PHD!$A$7:$A$7,"
TEMP1 = "=PHDGetData(""PHD_HOST"","
'TEMP1_1 = "*=PHDGetData(""PHD_HOST"","
TEMP2 = """"", ""Snapshot"","
TEMP3 = ",0, ""After"", UNI_RET_VALUE, UNI_PRES_MERGED)"
Sheets("PI_PHD").Select
Range("b7") = TEMP1 & TagList & StartTime & EndTime & TEMP2 &
TimeIncrement & TEMP3

End Sub

essentially i want to cycle tag list through A8, A9, A10 etc to the
end of data

please help!