Copying Conditional formatting in Excel using VB.net? -
i have column 'a' in worksheet 'two' , column 'b' in worksheet 'one' !
i want copy conditional formatting of column in 2 column b in 1 !
basically, want copy column in 2 column b in 1 except data !
please !!
i have :
sheeta & sheetb object objects in code using vb.net i newbie in vb.net - please !
here's bit of push:
oexcel = createobject("excel.application") book = oexcel.workbooks.open("c:\users\jonathan\documents\test2.xlsx") sheet = book.worksheets(1) sourcerange = sheet.range("a1:a" & sheet.range("a1").end(excel.xldirection.xldown).row) destrange = sheet.range("d1:d" & sheet.range("d1").end(excel.xldirection.xldown).row) the meat of part, take format conditions 1 range , add other. assumes there 1 criterion formatting. more 1 require step on of them (i think there 3) using sourcerange.formatconditions(i) in loop 1 sourcerange.formatconditions.count
destrange.formatconditions.add(excel.xlformatconditiontype.xlcellvalue, sourcerange.formatconditions(1).operator, sourcerange.formatconditions(1).formula1) destrange.formatconditions(1).interior.colorindex = sourcerange.formatconditions(1).interior.colorindex
Comments
Post a Comment