clvestin
09-08-2005, 06:11 AM
To be brief:
I sort a delimited file via a set category stamp. I then place each category's data on a seperate sheet, and chart the last 75 to 100 values of a number of select columns. Because these columns have no names, I must provide them (as well as sheet and column names too).
My method:
Sub rni4(ByVal m As Integer) ' "m" is the index (0 to 4) of a list box selection
Call labels(m) 'A sub holding nothing but arrays of columns and names
Set new2sheet = Sheets.Add(Type:=xlWorksheet)
new2sheet.Name = shtname(t) 'This is where I name the sheet
Sheet1.Rows.Range("a" & crow, "a" & drow - 1).EntireRow.Copy Destination:=Worksheets(shtname(t)).Range("a1:a1")
'This is where I produce the names for charts
Public Sub labels(ByVal m As Integer)
coldata0 = Array("b", "c") 'Boiloff columns
coldata1 = Array("c", "d", "f", "g") '301A columns
coldata2 = Array("c", "d", "f", "g") '301B columns
coldata3 = Array("b", "g", "e", "f") 'ColdBox columns
coldata4 = Array("b", "c", "x", "z") 'Temps columns
namdata0 = Array("Flow", "SucTemp") 'BO
namdata1 = Array("Suction", "Discharge", "TIT", "TOT") '301A
namdata2 = Array("Suction", "Discharge", "TIT", "TOT") '301B
namdata3 = Array("CB1_Temp", "CB2_Temp", "MidPt_Temp", "FlowTot") 'CB
namdata4 = Array("Gas_Temp", "Pressure", "CB_Flow", "ReactHtr_Temp") 'Tmps
If m = 0 Then coldata = coldata0
If m = 0 Then namdata = namdata0
If m = 1 Then coldata = coldata1
If m = 1 Then namdata = namdata1
If m = 2 Then coldata = coldata2
If m = 2 Then namdata = namdata2
If m = 3 Then coldata = coldata3
If m = 3 Then namdata = namdata3
If m = 4 Then coldata = coldata4
If m = 4 Then namdata = namdata4
I'm simply looking for a better way of addressing an unlabeled delimited file.
This method is crude, I know, but it was produced in a flurry of inspiration (perhaps misguided) and by golly, it works. Any thoughts are appreciated.
I sort a delimited file via a set category stamp. I then place each category's data on a seperate sheet, and chart the last 75 to 100 values of a number of select columns. Because these columns have no names, I must provide them (as well as sheet and column names too).
My method:
Sub rni4(ByVal m As Integer) ' "m" is the index (0 to 4) of a list box selection
Call labels(m) 'A sub holding nothing but arrays of columns and names
Set new2sheet = Sheets.Add(Type:=xlWorksheet)
new2sheet.Name = shtname(t) 'This is where I name the sheet
Sheet1.Rows.Range("a" & crow, "a" & drow - 1).EntireRow.Copy Destination:=Worksheets(shtname(t)).Range("a1:a1")
'This is where I produce the names for charts
Public Sub labels(ByVal m As Integer)
coldata0 = Array("b", "c") 'Boiloff columns
coldata1 = Array("c", "d", "f", "g") '301A columns
coldata2 = Array("c", "d", "f", "g") '301B columns
coldata3 = Array("b", "g", "e", "f") 'ColdBox columns
coldata4 = Array("b", "c", "x", "z") 'Temps columns
namdata0 = Array("Flow", "SucTemp") 'BO
namdata1 = Array("Suction", "Discharge", "TIT", "TOT") '301A
namdata2 = Array("Suction", "Discharge", "TIT", "TOT") '301B
namdata3 = Array("CB1_Temp", "CB2_Temp", "MidPt_Temp", "FlowTot") 'CB
namdata4 = Array("Gas_Temp", "Pressure", "CB_Flow", "ReactHtr_Temp") 'Tmps
If m = 0 Then coldata = coldata0
If m = 0 Then namdata = namdata0
If m = 1 Then coldata = coldata1
If m = 1 Then namdata = namdata1
If m = 2 Then coldata = coldata2
If m = 2 Then namdata = namdata2
If m = 3 Then coldata = coldata3
If m = 3 Then namdata = namdata3
If m = 4 Then coldata = coldata4
If m = 4 Then namdata = namdata4
I'm simply looking for a better way of addressing an unlabeled delimited file.
This method is crude, I know, but it was produced in a flurry of inspiration (perhaps misguided) and by golly, it works. Any thoughts are appreciated.