Hi Everyone,
I currently bring in a text file into Access. After deleting all unnecesary data I am left with the following table:
Description Totals GroupSet CycleDate
Cycle Date 05/19/2006
LOB010 010
OFFSET $500
HISTORY $100
TOTAL $600
Cycle Date 05/22/2006
LOB020 020
OFFSET $400
HISTORY $400
TOTAL $800
*** END OF REPORT ***
I need a way to copy the GroupSet number and CycleDate as they change so the resulting table is as follows:
Description Totals GroupSet CycleDate
Cycle Date 010 05/19/2006
LOB010 010 05/19/2006
OFFSET $500 010 05/19/2006
HISTORY $100 010 05/19/2006
TOTAL $600 010 05/19/2006
Cycle Date 010 05/22/2006
LOB020 020 05/22/2006
OFFSET $400 020 05/22/2006
HISTORY $400 020 05/22/2006
TOTAL $800 020 05/22/2006
*** END OF REPORT ***
I currently use the following program in Excel to do this but don't know how to convert it into Access VBA.
TheTop:
TheCells = ActiveCell.Formula
Selection.NumberFormat = "General"
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
If ActiveCell.Value = "" Then
ActiveCell.FormulaR1C1 = "=If(RC[-2] = ""*** END OF REPORT ***"", ""END"", """")"
If ActiveCell.Value = "END" Then
GoTo Top
Else
Selection.NumberFormat = "@"
ActiveCell.Formula = TheCells
End If
Else
GoTo TheTop
End If
GoTo TheTop
Top:
Columns("E:E").Select
Selection.NumberFormat = "mm/dd/yyyy"
Range("E2").Select
Thanks!
I currently bring in a text file into Access. After deleting all unnecesary data I am left with the following table:
Description Totals GroupSet CycleDate
Cycle Date 05/19/2006
LOB010 010
OFFSET $500
HISTORY $100
TOTAL $600
Cycle Date 05/22/2006
LOB020 020
OFFSET $400
HISTORY $400
TOTAL $800
*** END OF REPORT ***
I need a way to copy the GroupSet number and CycleDate as they change so the resulting table is as follows:
Description Totals GroupSet CycleDate
Cycle Date 010 05/19/2006
LOB010 010 05/19/2006
OFFSET $500 010 05/19/2006
HISTORY $100 010 05/19/2006
TOTAL $600 010 05/19/2006
Cycle Date 010 05/22/2006
LOB020 020 05/22/2006
OFFSET $400 020 05/22/2006
HISTORY $400 020 05/22/2006
TOTAL $800 020 05/22/2006
*** END OF REPORT ***
I currently use the following program in Excel to do this but don't know how to convert it into Access VBA.
TheTop:
TheCells = ActiveCell.Formula
Selection.NumberFormat = "General"
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
If ActiveCell.Value = "" Then
ActiveCell.FormulaR1C1 = "=If(RC[-2] = ""*** END OF REPORT ***"", ""END"", """")"
If ActiveCell.Value = "END" Then
GoTo Top
Else
Selection.NumberFormat = "@"
ActiveCell.Formula = TheCells
End If
Else
GoTo TheTop
End If
GoTo TheTop
Top:
Columns("E:E").Select
Selection.NumberFormat = "mm/dd/yyyy"
Range("E2").Select
Thanks!