How to set style in Range object?

  • Thread starter Thread starter SmartGuy
  • Start date Start date
S

SmartGuy

Hi all:
I have two cells:
A B
1 Cell1, Cell2

---------------------------
In excel , i manually set "Cell Styles" to them with "Check Cell", "Heading
1" ... etc.
Question:
I want to code (c#) Cell1 ,Cell2 with such Style, how could i do ?

Sample code is welcomed , especially for c# code.
Thanks in advanced.

Ding Li
 
Use macro record - you will see the something like
Selection.Font.Superscript = True

Simply use your Excel.Range Object (or OLE) to change the desired
values.
 
I can't use macro record because I have to create a new blank excel sheet.
So , is there any c# solution ?
 
What do you mean by "I need to create a blank sheet"?
I meaned simple action: Open Excel record macro Cut&Paste Macro into
your code, close Excel, correct objects for your namespace.
Or you don't know how to perform Excel.Application.Workbooks.Open ?
 
I got your idea. Record what you have done in excel and take advantage of
these codes.
Thanks, i will try.
 
Back
Top