Segregatting the data into different tabs based upon the names

Vimal_ku_mar

New Member
Joined
Jan 27, 2012
Messages
44
Hi,

Iam working on a file which distributes the data in different sheets of the same file.

I need the different sheets data to be saved as a different files with the tab names.

Can someone please help me with this.

Thanks,
Vimal
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,

Iam working on a file which distributes the data in different sheets of the same file.

I need the different sheets data to be saved as a different files with the tab names.

Can someone please help me with this.

Thanks,
Vimal

How about this:

Sub CreateWorkbooks()
'Creates an individual workbook for each worksheet in the active workbook.
Dim wbDest As Workbook
Dim wbSource As Workbook
Dim sht As Object
Dim strSavePath As String

On Error GoTo ErrorHandler

Application.ScreenUpdating = False

strSavePath = "C:\Temp\" 'Change to your local directory
Set wbSource = ActiveWorkbook

For Each sht In wbSource.Sheets
sht.Copy
Set wbDest = ActiveWorkbook
wbDest.SaveAs strSavePath & sht.Name
wbDest.Close 'Remove this if you don't want each book closed after saving.
Next

Application.ScreenUpdating = True

Exit Sub

ErrorHandler: 'Just in case something hideous happens
MsgBox "An error has occurred. Error number=" & Err.Number & ". Error description=" & Err.Description & "."
End Sub
 
Upvote 0
i need the data to be segregated from one sheet to different sheets in the same workbook based upon the name field. this macro will create different files based upon the work sheets
 
Upvote 0
Iam sorry but i don't see it.
Hover your mouse over the words 'this similar thread' at the end of my post and you will see it is a link which you can click to take you to the thread in question.
 
Upvote 0
Can someone please give me a macro which copies data from my main sheet to different tabs based upon name field.

Ima getting all complicated macro's which is making my file go haywire.

can someone please help me with a simple macro
 
Upvote 0
... making my file go haywire.
That's a pretty vague description which gives us nothing to move forward with.

The macro I provided in post #5 of the thread I linked to is not that complicated - at least it isn't very long. It has a few assumptions listed above it and it has two lines in it that are clearly marked as needing modification.

1. Are the 4 assumptions I listed applicable to your situation (at least numbers 3 & 4 as 1 and 2 are dealt with in the code)? If not, please give details.

2. Did you modify the 2 lines near the top to match your sheet name and column number and then try the code? If so, and it did not produce the correct results for you, please explain in what way it did not.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,920
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top