Sunday, November 29, 2009

Searching a value in excel and mark row with color

Set appExcel = CreateObject("Excel.Application")
appExcel.visible=true
Set objWorkBook = appExcel.Workbooks.Open ("C:\IT_TEam.xls")
Set objsheet = objWorkBook.sheets("Sheet1")
''With objsheet.UsedRange
''Set a = .Find("")
For Each a in objsheet.UsedRange
If a = "" Then
a.Interior.ColorIndex = 50
End If
'Set a= .FindNext(a)
Next
'End with
objworkbook.Save
objworkbook.Close
Set appExcel = nothing

No comments:

Post a Comment