Hello everyone,
I've be wrestling with this code for days, and I'm finally getting it to where I want it. One problem I'm having right now is combining data from two cells into one cell and getting it to iterate down the column:
I have a data column, but unfortunately the automatically generated file separates hours minutes and seconds. I need to put the hours and minutes into a single cell on another sheet and also have it iterate the same way the rest of the data does. It should pull data from my specified starting point and then every 76th cell in the same column. I have all but the time working properly at this point.
I've included the code below. Thanks in advance for any help.
There is more code above what is shown below, but that all seems to be working fine.
I've be wrestling with this code for days, and I'm finally getting it to where I want it. One problem I'm having right now is combining data from two cells into one cell and getting it to iterate down the column:
I have a data column, but unfortunately the automatically generated file separates hours minutes and seconds. I need to put the hours and minutes into a single cell on another sheet and also have it iterate the same way the rest of the data does. It should pull data from my specified starting point and then every 76th cell in the same column. I have all but the time working properly at this point.
I've included the code below. Thanks in advance for any help.
There is more code above what is shown below, but that all seems to be working fine.
Code:
Dim dateRowTo As Long: dateRowTo = 3 'row copied data begins to appear in
Dim dateRowFrom As Long: dateRowFrom = 6 'row data is copied from
Dim modeRowTo As Long: modeRowTo = 3
Dim modeRowFrom As Long: modeRowFrom = 11
Dim AxATo As Long: AxATo = 3
Dim AxAFrom As Long: AxAFrom = 31
Dim AxCTo As Long: AxCTo = 3
Dim AxCFrom As Long: AxCFrom = 60
Dim TimehourTo As Long: TimehourTo = 3
Dim TimehourFrom As Long: TimehourFrom = 7
Dim TimeminTo As Long: TimeminTo = 3
Dim TimeminFrom As Long: TimeminFrom = 7
Dim timeto As Long: timeto = 3
Dim timefrom As Long: timefrom = 7
max = wsraw.UsedRange.Rows.Count
Dim loop_ctr As Integer
With wsSPC
nr = .Columns("A").Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row + 1
For max = 1 To 60
'Date
Worksheets("Mik4 Raw Data").Cells(dateRowFrom, 2).copy Cells(dateRowTo, "A")
dateRowFrom = dateRowFrom + 76
dateRowTo = dateRowTo + 1
'Mode
Worksheets("Mik4 Raw Data").Cells(modeRowFrom, 2).copy Cells(modeRowTo, "C")
modeRowFrom = modeRowFrom + 76
modeRowTo = modeRowTo + 1
'Axis A
Worksheets("Mik4 Raw Data").Cells(AxAFrom, 3).copy Cells(AxATo, "D")
AxAFrom = AxAFrom + 76
AxATo = AxATo + 1
'Axis C
Worksheets("Mik4 Raw Data").Cells(AxCFrom, 3).copy Cells(AxCTo, "E")
AxCFrom = AxCFrom + 76
AxCTo = AxCTo + 1
'Time
'Worksheets("Mik4 Raw Data").Cells(TimehourFrom, 3).copy Cells(TimehourTo, "B")
'TimehourFrom = TimehourFrom + 76
'TimehourTo = TimehourTo + 1
.Range("B3") = (wsraw.Range("B7").Value - 12 & ":" & wsraw.Range("C7").Value)
'Worksheets("Mik4 Raw Data").Cells(timefrom, 3 & 4).copy Cells(timeto, "B")
'timefrom = timefrom + 76
'timeto = timeto + 1
loop_ctr = loop_ctr + 1
Next max
End With
End Sub