LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Format

I am running some codes for 15 sheets that I have recorded them and I want to
write the codes down in simpler instructions. Please any ideas to solve that?
Thanks

Macro 1: I am running this code for 14 different ranges in 15 sheets (first
instruction is to delete 16 sheet that no needed)


Sub Formatline1()

Sheets("WSP_TOC").Select
ActiveWindow.SelectedSheets.Delete


Sheets("WSP_Sheet1").Select
Range("A6:C6").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

Macro 2

Sub Color()
'
' Color Macro
' Macro recorded 5/6/2008 by faborenh
'

'
Sheets("WSP_Sheet1").Select
Range("B6:C6").Select
Selection.Interior.ColorIndex = 8
Range("A7:A10").Select
Selection.Interior.ColorIndex = 44
Range("A11:A14").Select
Selection.Interior.ColorIndex = 35
Range("A15:A18").Select
Selection.Interior.ColorIndex = 33
Range("A19:A22").Select
Selection.Interior.ColorIndex = 36
Range("A23:A25").Select
Selection.Interior.ColorIndex = 4
Range("A26:A29").Select
Selection.Interior.ColorIndex = 39
Range("A30:A33").Select
Selection.Interior.ColorIndex = 3
Range("A34:A36").Select
Selection.Interior.ColorIndex = 42
Range("A37:A39").Select
Selection.Interior.ColorIndex = 46
Range("A40:A42").Select
Selection.Interior.ColorIndex = 43
Range("A43:A45").Select
Selection.Interior.ColorIndex = 38
Range("A46:A48").Select
Selection.Interior.ColorIndex = 8
Range("A49:A52").Select
Selection.Interior.ColorIndex = 6

Macro 3

Sub ConditionalFormat()
'
' ConditionalFormat Macro
' Macro recorded 5/6/2008 by faborenh
'

'
Sheets("WSP_Sheet1").Select
Range("C7:C52").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="0"
Selection.FormatConditions(1).Font.ColorIndex = 3

Macro 4

Sub Letter12andBold()
'
' Letter12andBold Macro
' Macro recorded 5/6/2008 by faborenh
'

'
Sheets("WSP_Sheet1").Select
Range("A6:C52").Select
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Selection.Font.Bold = False
Selection.Font.Bold = True

Macro 5

Sub Adjust1column()
'
' HAdjust1column Macro
' Macro recorded 2006-11-23 by faborenh
'

'
Sheets("WSP_Sheet1").Select
Columns("A:A").EntireColumn.AutoFit

Macro 6
Sub Deselect()
'
' FDeselect Macro
' Macro recorded 2006-11-23 by faborenh
'

'
Range("C1").Select
Sheets("WSP_Sheet15").Select

Macro 7

Sub Pagesetup()
'
' GPagesetup Macro
' Macro recorded 2006-11-23 by faborenh
'

'
Sheets("WSP_Sheet1").Select
With ActiveSheet.Pagesetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.Pagesetup.PrintArea = "$A$1:$C$55"
With ActiveSheet.Pagesetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Adding time in 24 hour format to produce hours in decimal format Hercdriver Excel Worksheet Functions 11 December 29th 09 02:06 AM
Need help with converting CUSTOM format/TEXT format to DATE format Deo Cleto Excel Worksheet Functions 6 June 2nd 09 08:14 PM
how to format excel format to text format with separator "|" in s. azlan New Users to Excel 1 January 31st 05 12:57 PM
Keep format after paste from other worksheets - conditional format or EnableControl solution doesn't work No Name Excel Programming 0 May 3rd 04 12:22 PM


All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"