Hi
I am using VS2012, VB.Net with the Excel 14.0 library.
I have created an application which compares stock values between an Excel spread-sheet and a table within an SQL database, creating a 'movements' spread-sheet. This all works exactly as I want, however, to help my user view the movements easily, I want to apply conditional formatting to highlight the positive and negative movements....this is where I struggle...a lot!
My movements are in column E and range from row 3 to a variable number of rows dependant on the original spread-sheet. If the movement cell value is greater than zero I want to colour the cell green and conversely, if the movement cell value is less than zero, I want to colour the cell green. I have managed to get cells to change colour but it effects every row and every cell and they are all the same colour so I suspect my issue is I'm not selecting the range or the specific cell correctly!
Could someone please advise what this code should look like?
Many thanks in anticipation!
Steve
I am using VS2012, VB.Net with the Excel 14.0 library.
I have created an application which compares stock values between an Excel spread-sheet and a table within an SQL database, creating a 'movements' spread-sheet. This all works exactly as I want, however, to help my user view the movements easily, I want to apply conditional formatting to highlight the positive and negative movements....this is where I struggle...a lot!
My movements are in column E and range from row 3 to a variable number of rows dependant on the original spread-sheet. If the movement cell value is greater than zero I want to colour the cell green and conversely, if the movement cell value is less than zero, I want to colour the cell green. I have managed to get cells to change colour but it effects every row and every cell and they are all the same colour so I suspect my issue is I'm not selecting the range or the specific cell correctly!
Could someone please advise what this code should look like?
Many thanks in anticipation!
Steve