tranchemontaigne
Registered User.
- Local time
- Today, 04:51
- Joined
- Aug 12, 2008
- Messages
- 203
BACKGROUND:
What I have already done is export data to MS Excel (via ADODB). What I want to do now is draw a box around the selected range. How do I do this.
GOAL:
Draw a border around the output range in the MS Excel export
SUMMARY OF EFFORT:
I can draw a border around each cell within the range, center align the values within each cell, and autofit the column width property with the following block of code
Unfortunately I don't want to outline every cell.
I want to outline a predefined range. If I was writing the code for execution within MS Excel VBA it would look like this. How do I adopt this block for execution within a MS Access VBA module?
Any help with syntax would be appreciated.
________
Granada (Europe)
What I have already done is export data to MS Excel (via ADODB). What I want to do now is draw a box around the selected range. How do I do this.
GOAL:
Draw a border around the output range in the MS Excel export
SUMMARY OF EFFORT:
I can draw a border around each cell within the range, center align the values within each cell, and autofit the column width property with the following block of code
With WS.Range("A1:X49")
.Columns.AutoFit
.HorizontalAlignment = xlHAlignCenter
.Borders.Weight = xlMedium
End With
Unfortunately I don't want to outline every cell.
I want to outline a predefined range. If I was writing the code for execution within MS Excel VBA it would look like this. How do I adopt this block for execution within a MS Access VBA module?
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.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Any help with syntax would be appreciated.
________
Granada (Europe)
Last edited: