Posted 8 September 2017, 2:02 pm ESTI'm using the rangecopy method to duplicate a set of columns in the same sheet it works fine except for the headers. Is there any way to copy the column headers?
Posted by: edinsf on 8 September 2017, 2:02 pm EST
Replied 8 September 2017, 2:02 pm EST
I am not sure if this can be done using either the CopyRange or MoveRange method within a sheet. However, in case you have more than one sheet in your spread and want to copy the column header information from Sheet1 to Sheet2, then this can be done as follows:<blockquote>
FpSpread1.Sheets(1).Models.ColumnHeaderData = FpSpread1.Sheets(0).Models.ColumnHeaderData</blockquote>
In case, you want to copy the column header style information (backcolor, forecolor,border etc), then you can use the <b>ColumnHeaderStyleModel </b>
Hope this helps. Thanks