wagon_rider
New Member
- Joined
- Aug 27, 2012
- Messages
- 8
Hi everyone,
I would like like to take two tables of data and make them into a long list.
(rows 7-102 is data "in") and (105 to 200 is data "out")
Columns are days of the week for a quarter.
I am trying to make one column with:
day1, 00:15, in
day1, 00:30, in
(every 15mins) for the day
day1, 00:15, out
day1, 00:30, out
then starting on the next column in the table day 2
day 2, 00:15, out
I have managed one column but I have lost confidence / steam.... with looping through the other 90 columns! perhaps someone can assist please?
I have made code to insert rows in front of my data tables, and with a date/time and in/out column
I have been out of the business of writing vba for sometime, but today I'm trying.... badly...
I would like like to take two tables of data and make them into a long list.
(rows 7-102 is data "in") and (105 to 200 is data "out")
Columns are days of the week for a quarter.
I am trying to make one column with:
day1, 00:15, in
day1, 00:30, in
(every 15mins) for the day
day1, 00:15, out
day1, 00:30, out
then starting on the next column in the table day 2
day 2, 00:15, out
VBA Code:
Sub list()
'
' list Macro
'
Columns("A:H").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
'set headers
Range("A1").Value = "time"
Range("B1").Value = "date"
Range("C1").Value = "idcolumn"
Range("D1").Value = "datetimecolumn"
Range("E1").Value = "cash"
' Time
Range("A2:A97").Value = Range("I7:I102").Value
Range("A98:A193").Value = Range("I7:I102").Value
'date
Range("B2:B193").Value = Range("J6").Value
Range("D2").Select
Selection.NumberFormat = "yyyy-mm-ddThh:mm:ss"
ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-3]"
Range("D2").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("D2:D193")
With Range("D2:D193").CurrentRegion
.Value = .Value
End With
'id
Range("C2:C97").Value = [I6] & ActiveSheet.Name
Range("C98:C193").Value = [I104] & ActiveSheet.Name
'Values
Range("E2:E97").Value = Range("J7:J102").Value
Range("E98:E193").Value = Range("J105:J200").Value
End Sub
I have managed one column but I have lost confidence / steam.... with looping through the other 90 columns! perhaps someone can assist please?
I have made code to insert rows in front of my data tables, and with a date/time and in/out column
I have been out of the business of writing vba for sometime, but today I'm trying.... badly...