Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have a short piece of code that finds the last entry in a row and then inserts a new column. what should happen is that all formats from should be duplicated, but for some reason cell borders are not being copied. Set rCtr = Sheets("badges").Range("d1") ' add new name to badges list Do If rCtr.Value < "" Then Set rCtr = rCtr.Offset(0, 1) Else rCtr.EntireColumn.Insert ,_ CopyOrigin:=xlFormatFromLeftOrAbove rCtr.Offset(0, -1) = FmNewBeaver.tbName Exit Do End If Loop Can anyone suggest why this is happening and how to fix it? TIA Dave |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Try this vba Sub copycolSAS() Dim lc As Long With Sheets("badges") lc = .Cells(1, Columns.Count).End(xlToLeft).Column .Columns("d").Copy .Columns(lc).Insert End With Application.CutCopyMode = False End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Risky Dave" wrote in message ... Hi, I have a short piece of code that finds the last entry in a row and then inserts a new column. what should happen is that all formats from should be duplicated, but for some reason cell borders are not being copied. Set rCtr = Sheets("badges").Range("d1") ' add new name to badges list Do If rCtr.Value < "" Then Set rCtr = rCtr.Offset(0, 1) Else rCtr.EntireColumn.Insert ,_ CopyOrigin:=xlFormatFromLeftOrAbove rCtr.Offset(0, -1) = FmNewBeaver.tbName Exit Do End If Loop Can anyone suggest why this is happening and how to fix it? TIA Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying formats - column widths, formats, outlining to worksheets | Excel Worksheet Functions | |||
Copy column, paste special formulas & number formats doesn't work | Excel Discussion (Misc queries) | |||
Copy Color Formats Based On Column Date Values | Excel Discussion (Misc queries) | |||
copy formats column width & row heights between Excel WORKSHEETS? | Excel Discussion (Misc queries) | |||
copy a sheet with all formats - column widths, etc? | Excel Programming |