XLA Routines: EE_FormatCols
Useful routine for formatting columns from an imported file
Sub EE_FormatCols(rngSource As Range, Optional rngTarget As Range) 'http://excelexperts.com/xla-routines-eeFormatCols for updates on this sub routine ' takes a source range containing the heading and format in 2 cols ' looks in the target range and formats the target range Dim rngHd As Range Dim rngFound As Range Call EE_Start Set rngTarget = EE_TableDefault(rngTarget).Rows(1) For Each rngHd In rngSource.Rows Set rngFound = rngTarget.Find(rngHd.Cells(1).value, , xlValues, xlWhole) If Not rngFound Is Nothing Then rngHd.Cells(, 2).Copy rngFound.Parent.Columns(rngFound.Column).EntireColumn.PasteSpecial xlPasteFormats rngHd.Cells(1).Copy rngFound.PasteSpecial xlPasteFormats End If Next Call EE_End End Sub
»
- Nick's blog
- Login or register to post comments
- 22633 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago