Spire.Spreadsheet is a powerful component to view spreadsheet. As a standalone spreadsheet class library, Spire.Spreadsheet is a companion component to Spire.XLS, which mainly focus on how to display spreadsheet.

Sun Nov 04, 2018 12:47 pm

hey,

Is it possible to set a style to a cell.

thank you GH

GHWels
 
Posts: 90
Joined: Sun Nov 23, 2014 7:22 pm

Mon Nov 05, 2018 2:30 am

Hi GH,

Thanks for your inquiry.
Spire.Spreadsheet could set a style format to a cell, please right-click cells and find the option "Format cells".
If I misunderstand your meaning, please describe your requirement in detail.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Nov 05, 2018 5:57 am

Hey,
I want to define the style like spire.xls

'Dim style As CellStyle = .Styles.Add("RedText")
'style.Font.FontName = "Calibri"
'style.Font.Color = Color.Red
'style.Font.Size = 12
'style.Font.IsBold = True
'style.Font.IsItalic = True

and set the style "RedText" to a cell
Gh

GHWels
 
Posts: 90
Joined: Sun Nov 23, 2014 7:22 pm

Mon Nov 05, 2018 8:22 am

Hi GH,

Please refer to following code to achieve your target:
Code: Select all
spreadsheet1.ActiveWorksheet.GetActiveCell().Font = New Font("Calibri", 16, FontStyle.Bold Or FontStyle.Italic)
spreadsheet1.ActiveWorksheet.GetActiveCell().FontColor = Color.Red

Any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Nov 05, 2018 12:48 pm

Thank you, for your fast help.
GH

GHWels
 
Posts: 90
Joined: Sun Nov 23, 2014 7:22 pm

Tue Nov 06, 2018 1:28 am

Hi GH,

Thanks for your feedback.
Any question, just feel free to contact us.
Have a nice day!

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Spreadsheet