• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Split excel file into separate files|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Split excel file into separate files|VBA & Macros|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosSplit excel file into separate file…
sp_PrintTopic sp_TopicIcon
Split excel file into separate files
Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
1
June 15, 2020 - 8:27 am
sp_Permalink sp_Print

Hi folks,

Hope everyone is well

Could you please help me to create macro to do below steps.

  • First Tab will contain Template.
  • Second Tab will contain all Data need to separate it in the template to separated files.
  • Each file will contain the Manufacturer Name and all Manufacturer PN.
  • The file will be named by MFR name after removing special characters. Ex: Intel, Inc,  so file name should be IntelInc
  • The separated files will be filled based in MFR name. as Col A will contain MFR name, Column B will contain MFR PN, Column C will contain the Required Data. All data available from second sheet.
  • If the MFR PN is duplicate due it have multi required data, it should collected in one cell separated by |

Please check attached sample.

Your assistance is greatly appreciated.

Thanks;

Marsil

sp_AnswersTopicSeeAnswer See Answer
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
2
June 15, 2020 - 10:44 pm
sp_Permalink sp_Print

Hi Marsil

I have had a quick look and it seems you want a fairly comprehensive process automated – have you made a start with coding this or do you already have a manual process with formulas that achieves the desired result?

Most of the time these forums are for people to troubleshoot a problem or learn how to do something quite complex.

If you can post what part is causing the issue I am sure there are people on here that can help.

Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
3
June 16, 2020 - 12:52 am
sp_Permalink sp_Print

Thank you Purfleet for fast reply.

Yes I have attached macro and I want to update it's output to be with the same format for template

Output-image.pngImage Enlarger

Correct-Format.pngImage Enlarger

this macro split to sheets then files, I just want to update the files to be have the same template.

 

Thanks;

Marsil

sp_PlupAttachments Attachments
  • sp_PlupImage Output-image.png (75 KB)
  • sp_PlupImage Correct-Format.png (149 KB)
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
4
June 17, 2020 - 3:38 pm
sp_Permalink sp_Print

I have added some loops at the bottom to copy over formatting etc

Dim fRange As Range
Dim tRange As Range

Set tRange = Worksheets("Template").Range("a1:f4")
Set fRange = Worksheets("Template").Range("a1").CurrentRegion

'fRange.Copy
Set P1 = Worksheets("Template").Shapes.Copy

'Top Bit
tRange.Copy

For Each ws In ThisWorkbook.Worksheets

If ws.Name <> "Template" Then
ws.Activate
ws.Range("a1:f4").PasteSpecial xlPasteAll
'ws.Range("a1").PasteSpecial xlPasteColumnWidths
End If

Next ws

'Column Widths
fRange.Copy

For Each ws In ThisWorkbook.Worksheets

If ws.Name <> "Template" Then
ws.Activate
ws.Range("a1").PasteSpecial xlPasteColumnWidths
ws.Range("a1").CurrentRegion.Rows.AutoFit
ws.Range("1:3").Rows.RowHeight = 23

End If

Next ws

'Logo

For Each ws In ThisWorkbook.Worksheets

If ws.Name <> "Template" Then
Worksheets("Template").Range("a1:a3").CopyPicture xlScreen, xlPicture
ws.Paste Destination:=ws.Range("a1")
End If

Next ws

sp_AnswersTopicAnswer
Answers Post
Avatar
Marsil Sarvis
Member
Members
Level 0
Forum Posts: 73
Member Since:
September 6, 2019
sp_UserOfflineSmall Offline
5
June 21, 2020 - 4:23 am
sp_Permalink sp_Print sp_EditHistory

Hi Purfleet

You are amazing!  Thank you so much!

I just need your help to know how I can change in code to modify logo size

I tried but it is not work correctly.

Please check attached file.

Grateful for your support..

Thanks;

Marsil

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mohamed Jelle Hussein, Stanislas Louzier
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27829

 

Member Stats:
Guest Posters: 49
Members: 32346
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.