Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2014, 11:58 PM
Tyberian1988 Tyberian1988 is offline How to copy format of a column using spin button Windows 7 64bit How to copy format of a column using spin button Office 2010 64bit
Novice
How to copy format of a column using spin button
 
Join Date: Mar 2014
Posts: 3
Tyberian1988 is on a distinguished road
Lightbulb 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
Reply With Quote
  #2  
Old 03-08-2014, 10:47 PM
macropod's Avatar
macropod macropod is offline How to copy format of a column using spin button Windows 7 32bit How to copy format of a column using spin button Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
Note: As coded, any spin-down resets to Column A.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-10-2014, 10:09 PM
Tyberian1988 Tyberian1988 is offline How to copy format of a column using spin button Windows 7 64bit How to copy format of a column using spin button Office 2010 64bit
Novice
How to copy format of a column using spin button
 
Join Date: Mar 2014
Posts: 3
Tyberian1988 is on a distinguished road
Thumbs up

Thank you very much.Sorry for code tags.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy format of a column using spin button 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
How to copy format of a column using spin button Copy table format efilipe PowerPoint 3 09-01-2012 01:46 AM
How to copy format of a column using spin button Copy Paste ruins format korric Word 1 04-08-2012 05:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft