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: 2
Default need some editing of a template macro.

this is a macro that takes information from a data sheet and copies it
onto a new sheet using the template for each column of data. atleast
thats what im trying to do. if someone could help me to edit this, i
would greatly appreciate it. thanks.

also, i'd like for each new sheet made to have the name from cell A1
(or the first row in the corrisponding column on the data sheet, ex:
data!b1, data!c1, etc.)

Sub TEMPLATE()
'
' TEMPLATE Macro
' MAKES NEW SHEETS FOR DATA USING TEMPLATE
'
For c = 1 To Lastcol

'
Sheets.Add
ActiveCell.Range("A1").FormulaR1C1 = "=Data!1, & c &"
ActiveCell.Range("A2").FormulaR1C1 = "=Data!2, & c &"
ActiveCell.Range("A3").FormulaR1C1 = "=CONCATENATE(Data!3, & c &,
"" "", Data!4, & c &, "", "", Data!5, & c &)"
ActiveCell.Range("A5").FormulaR1C1 = "=Data!7, & c &"
ActiveCell.Range("A7").FormulaR1C1 = "=CONCATENATE(""Acct # "",
Data!9, & c &)"
ActiveCell.Range("A8").FormulaR1C1 = "=Data!10, & c &"
ActiveCell.Range("C8").FormulaR1C1 = "=CONCATENATE(""Smartlease
Plus - "", Data!11, & c &)"
ActiveCell.Range("A10").FormulaR1C1 = "=CONCATENATE(Data!13, & c &,
"" HUMMER "", Data!14, & c &)"
ActiveCell.Range("A12").FormulaR1C1 = "=CONCATENATE(Data!16, & c &,
"" Month Term"")"
ActiveCell.Range("A13").FormulaR1C1 = "Start Date"
ActiveCell.Range("A14").FormulaR1C1 = "End Date"
ActiveCell.Range("B13").FormulaR1C1 = "=Data!17, & c &"
ActiveCell.Range("B14").FormulaR1C1 = "=Data!18, & c &"
ActiveCell.Range("A16").FormulaR1C1 = "=Data!20, & c &"
ActiveCell.Range("A18").FormulaR1C1 = "=CONCATENATE(""VIN # "",
Data!22, & c &)"
Range("A1:C18").Select
With Selection.Font
.Name = "Times New Roman"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("A1").Select
Selection.Font.Underline = xlUnderlineStyleSingle
Range("A7").Select
Selection.Font.Bold = True
Columns("A:A").ColumnWidth = 14.29
Rows("1:18").Select
Range("A18").Activate
Selection.Rows.AutoFit

Next c

Exit Sub
MsgBox "done"

End Sub

 
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
editing a template kaja New Users to Excel 1 June 22nd 08 03:20 PM
Need help editing a macro ZBelden Excel Discussion (Misc queries) 3 February 12th 08 04:18 PM
Macro editing Skeeter Excel Discussion (Misc queries) 5 August 6th 07 01:40 AM
Editing a macro Dtmos01 Excel Discussion (Misc queries) 6 April 3rd 07 06:36 PM
Word Template - Editing Excel with VBA chesney Excel Programming 0 June 17th 04 09:29 AM


All times are GMT +1. The time now is 10:56 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"