Tuesday, October 4, 2011

Adding values into excel sheet and changing the cell values to Uppercase

Set xlapp = createobject("Excel.Application")
xlapp.Visible = true
set xlbook = xlapp.Workbooks.Open("C:\Documents and Settings\pavann\Desktop\test")
set xlsheet = xlbook.Worksheets("sheet1")
For i = 1 to 10
For j= 1 to 10
xlsheet.cells(i,1) = "pavan"
If j>1 Then
xlsheet.cells(i,j) = "soumya"
End If
Next
Next
set objrange = xlsheet.usedrange
For each objcell in objrange
objcell.value = Ucase(objcell.value)
Next

-- Pavankumar Nandagiri

Google Search

Google