#1
|
|||
|
|||
How to copy format of a column using spin button
hello everybody! i'm a new member on this forum and a beginner in programming.I would like to know how to paste the format of column(a) in column(c),(d),(e)...etc using a spin button.I need an increment for the pasted format. Any help, please?
Here is a copy of my code: Private Sub SpinButton1_SpinUp() Columns("A").Select Selection.Copy Columns("C").Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub |
#2
|
||||
|
||||
You could use code like:
Code:
Option Explicit Dim i As Long, lRow As Long Private Sub SpinButton1_SpinDown() i = 1 End Sub Private Sub SpinButton1_SpinUp() If i = 16 Then Exit Sub i = i + 1 With ActiveSheet lRow = .Cells.SpecialCells(xlCellTypeLastCell).Row .Range("A1:A" & lRow).Copy .Cells(1, i).PasteSpecial Paste:=xlPasteFormats End With End Sub PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you very much.Sorry for code tags.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to remove Spin button | hannu | Excel | 3 | 11-14-2013 01:42 AM |
Copy Column setting to other spreadsheets in an excel workbook | officeboy09 | Excel | 5 | 11-05-2013 01:49 AM |
Copy format created by a conditional formatting | spk | Excel | 2 | 04-10-2013 04:41 AM |
Copy table format | efilipe | PowerPoint | 3 | 09-01-2012 01:46 AM |
Copy Paste ruins format | korric | Word | 1 | 04-08-2012 05:31 AM |