|
-
change row colors in excel
okay so i have this code
<code>
Dim oexcel As Microsoft.Office.Interop.Excel.Application
Dim obook As Microsoft.Office.Interop.Excel.Workbook
Dim osheet As Microsoft.Office.Interop.Excel.Worksheet
oexcel = New Microsoft.Office.Interop.Excel.Application
obook = oexcel.Workbooks.Open("c:\test\test.xls")
osheet = obook.Worksheets(1)
Dim LastRow As Integer = osheet.UsedRange.Rows.Count
osheet.Range("A" & LastRow.ToString + 1).Value = Date.Now
osheet.Range("B" & LastRow.ToString + 1).Value = TextBox1.Text
obook.Save()
obook.Close()
oexcel.Quit()
oexcel = Nothing
</code>
this code basically writes rows to an excel sheet not overwriting any row but systematically enters new lines every time the button is pressed. each row has a column for type of visit i.e. appointment, new, rush
what i want to do is fill the rows with different colors for example if column "B" on whatever row says appointment i want the whole row to be red. ive never had to program the color of an excel row and could use some help! thanks in advance!!
Similar Threads
-
By Lennie in forum VB Classic
Replies: 1
Last Post: 08-17-2008, 02:24 AM
-
By OwenDavies in forum VB Classic
Replies: 0
Last Post: 03-09-2006, 08:40 PM
-
Replies: 2
Last Post: 07-01-2005, 12:03 PM
-
By Alexander Frolov [Afalina Co., Ltd.] in forum vb.announcements
Replies: 0
Last Post: 06-24-2002, 12:13 PM
-
By Jon Cohen in forum authorevents.vaughn
Replies: 1
Last Post: 05-31-2000, 12:43 AM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks