P
Paul Tikken
I'm using acces 2003;
I've got a document that I use for timeplanning, the document is as follows.
The first 3 rows dont serve any goal, other than there are buttons there for
running certain macro's.
In row 4, column ABCD (merged) shows the date.
In row 5 are times; from 00:00 till 23:59 every 15 min (from column E t/m
CW)
From row 6 t/m 69 (Column B till D) are filled with variabel data;
In rows 10, 15, 24 en 29 are locked for filling in data and may not be
exported to the acces document.
Column A doesn't hold any data;
Column B is filled with names;
In column C there is a number that is linked to the names in column B
In colomn D there is a number that is linked to number in column C
In the cells E6 t/m CW69 times and other data are being filled out by
selecting a number of cells and running the following macro;
Sub XXXX()
Set rngUsedRange = ActiveSheet.UsedRange
y = Selection.Columns.Count
x = ActiveCell.Row
z = Selection.Rows.Count
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = True
End With
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Font.ColorIndex = 0
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell.FormulaR1C1 = "=(R[" & (-x + 5) & "]C)&"" - ""&(R[" & (-x +
5) & "]C[" & (y) & "])&"" ""&" & z & "&"" XXXX AAAA"""
End Sub
This macro makes sure that the selection will merge and that the times, from
row 5, are automatically filled in (Left en recht border of the selection) +
some additional information (see the XXXX and AAAA in the formula). The
selections change every day, and so do the timings.
Now I would like to export the following information to a already excisting
acces file;
The dat in row 4, the information in column C, information in column D, the
start time in the merged selection, the end time in the merged selection.
This information needs to be exported to similar culomns in the acces file.
Example:
I select K11 till S13 and run the macro, there will appear a merged cel
containing
"01:30 - 03:45 2X XXXX AAAA". Now if I want to export the data from B4
(=Date), B11,C11,D11, starttime 01:30 and endtime 03:45 should go into a new
record in that acces file. and in another new record the same pricipal has to
be exported;
Data from B4, B12, C12, D12, start time 0130, endtime 0345 etc etc etc.
As many records need to be filled out as I have selected rows.
I know it's been a long story but I hope I made it clear enough
I hope somebody can help me with this!!
Thanks,
Paul
I've got a document that I use for timeplanning, the document is as follows.
The first 3 rows dont serve any goal, other than there are buttons there for
running certain macro's.
In row 4, column ABCD (merged) shows the date.
In row 5 are times; from 00:00 till 23:59 every 15 min (from column E t/m
CW)
From row 6 t/m 69 (Column B till D) are filled with variabel data;
In rows 10, 15, 24 en 29 are locked for filling in data and may not be
exported to the acces document.
Column A doesn't hold any data;
Column B is filled with names;
In column C there is a number that is linked to the names in column B
In colomn D there is a number that is linked to number in column C
In the cells E6 t/m CW69 times and other data are being filled out by
selecting a number of cells and running the following macro;
Sub XXXX()
Set rngUsedRange = ActiveSheet.UsedRange
y = Selection.Columns.Count
x = ActiveCell.Row
z = Selection.Rows.Count
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = True
End With
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Font.ColorIndex = 0
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
ActiveCell.FormulaR1C1 = "=(R[" & (-x + 5) & "]C)&"" - ""&(R[" & (-x +
5) & "]C[" & (y) & "])&"" ""&" & z & "&"" XXXX AAAA"""
End Sub
This macro makes sure that the selection will merge and that the times, from
row 5, are automatically filled in (Left en recht border of the selection) +
some additional information (see the XXXX and AAAA in the formula). The
selections change every day, and so do the timings.
Now I would like to export the following information to a already excisting
acces file;
The dat in row 4, the information in column C, information in column D, the
start time in the merged selection, the end time in the merged selection.
This information needs to be exported to similar culomns in the acces file.
Example:
I select K11 till S13 and run the macro, there will appear a merged cel
containing
"01:30 - 03:45 2X XXXX AAAA". Now if I want to export the data from B4
(=Date), B11,C11,D11, starttime 01:30 and endtime 03:45 should go into a new
record in that acces file. and in another new record the same pricipal has to
be exported;
Data from B4, B12, C12, D12, start time 0130, endtime 0345 etc etc etc.
As many records need to be filled out as I have selected rows.
I know it's been a long story but I hope I made it clear enough
I hope somebody can help me with this!!
Thanks,
Paul