How to AutFit Column of Excel in BluePrism
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-19 06:41 AM
Hi ,
I am creating one sheet in Excel at runtime and writing collection data into Excel.
I need to do some formatting for this.
1.Autofill Columns
2.Add boraders to all.
3.Bold Headers.
4.Add Background colour to header.
Anyone knows the solution for this?
Thanks,
Mohini
------------------------------
Mohini Shelke
RPA Developer
vElement It
------------------------------
I am creating one sheet in Excel at runtime and writing collection data into Excel.
I need to do some formatting for this.
1.Autofill Columns
2.Add boraders to all.
3.Bold Headers.
4.Add Background colour to header.
Anyone knows the solution for this?
Thanks,
Mohini
------------------------------
Mohini Shelke
RPA Developer
vElement It
------------------------------
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-08-19 08:31 AM
Can use the MS Excel VBO action Run Macro
and use the following macro "ExcelFormatting" as a start.
Change the cell references A:G and A1:G1 as needed or make them dynamic.
------------------------------
Roar Nilsen
Manager
Duit AS
Europe/Oslo
------------------------------
and use the following macro "ExcelFormatting" as a start.
Change the cell references A:G and A1:G1 as needed or make them dynamic.
Sub ExcelFormatting() 'Autofit columns Columns("A:G").AutoFit 'Format header Bold and background color Range("A1:G1").Cells.Font.Bold = True Range("A1:G1").Cells.Interior.Color = &HC0FFFF 'To format entire row use: Rows("1").Cells.Font.Bold = True 'Autofilter If FilterMode = False Then 'Turn on AutoFilter Range("A1:G1").AutoFilter Else 'Reset AutoFilter ActiveWorkSheet.ShowAllData Range("A1:G1").AutoFilter End If 'Borders Range("A1:" & Cells.SpecialCells(xlCellTypeLastCell).Address).Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous End With Range("A1").Select End Sub
------------------------------
Roar Nilsen
Manager
Duit AS
Europe/Oslo
------------------------------
