LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Inserting a line in a database - alternative colours

Hi. I need help when inserting a line in a database table. Macro below.
However, what I would like is that each line in this database is a
different fill colour, say grey, white, grey, white so I can easily
distinguish between them. How can I write into the macro to do this so
it knows what the colour of the line it is inserting should be?

Cheers

Application.ScreenUpdating = False
Range("A9:FI9").Select
Selection.Insert Shift:=xlDown
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)

.Weight = xlThin

End With
Selection.Font.Bold = False
Range("A9").Select
Range("B10:E10").Select
Selection.Copy
Range("B9").Select
Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone,
_
SkipBlanks:=False, Transpose:=False
Range("A9").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting information from a database with a macro Wombat Excel Discussion (Misc queries) 1 January 11th 10 11:11 AM
How do I reset the default colours in a line graph AIHW Charts and Charting in Excel 1 March 28th 06 11:53 PM
Inserting foreign/special characters from a database kfootit Excel Programming 2 January 11th 06 02:26 PM
Chart Default Line colours Phil Wales Excel Discussion (Misc queries) 2 June 13th 05 04:45 PM
Inserting an Access database into a spreadsheet? q Excel Programming 0 May 3rd 04 07:46 PM


All times are GMT +1. The time now is 06:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"