G
Guest
I have a docmd.TransferSpreadsheet and after I transfer it I am formatting
it. Everything I have up to these lines works to do the formatting. I just
recorded a Macro in Excel and then pasted the code into Access... Any ideas.
xlsApp.Range("A:C").Select
With xlsApp.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'xlsApp.Columns("F:F").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("H:H").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("J:K").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("Q:Q").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
xlsApp.Range("A1:AD1").Select
With xlsApp.Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
xlsApp.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
xlsApp.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With xlsApp.Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
it. Everything I have up to these lines works to do the formatting. I just
recorded a Macro in Excel and then pasted the code into Access... Any ideas.
xlsApp.Range("A:C").Select
With xlsApp.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'xlsApp.Columns("F:F").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("H:H").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("J:K").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
'xlsApp.Columns("Q:Q").Select
'xlsApp.Selection.HorizontalAlignment = xlCenter
xlsApp.Range("A1:AD1").Select
With xlsApp.Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
xlsApp.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
xlsApp.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With xlsApp.Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With xlsApp.Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With