• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Creating multiple workbooks with pre defined formatting

Hello Guys,

I need your help i want to create multiple work books with some predefined formatting.. i have just gone through this code:

Option Explicit
Sub SavetoWB() 'Excel VBA to export data
Const sPath = "D:\"
Dim ar As Variant
Dim i As Integer
Dim owb As Workbook
Range("A3", Range("A" & Rows.Count).End(xlUp)).AdvancedFilter xlFilterCopy, , [T1], True
ar = Range("T2", Range("T2").End(xlDown))
'Loop through all unique instances of the Results from the Advanced Filter.
For i = 1 To UBound(ar)
Range("A3", Range("A" & Rows.Count).End(xlUp)).AutoFilter 1, ar(i, 1)
Range("A3", Range("N" & Rows.Count).End(xlUp)).Copy 'Where Data is from Col A - N
Set owb = Workbooks.Add
owb.Sheets(1).[A1].PasteSpecial xlPasteValues
owb.SaveAs sPath & [A2]
owb.Close False 'Close no save
Next i
[a3].AutoFilter
Columns(20).EntireColumn.Clear
End Sub

This code is good for making multiple workbooks but i need all the data in particular formatting.. I have uploaded two files first file is master file name Book_ng and second is CSV

I want to create multiple books from book_ng's data in csv's formatting


Please help

Thanks
Manish Kumawat
 

Attachments

Back
Top