VBA to split worksheet into multiple sheets. Based on rows. Keeping formatting and headers

Aperras7

New Member
Joined
May 22, 2014
Messages
36
Hello all,

I know that this question has been asked a thousand time before, but I can't find the perfect one for me. I'm looking for a VBA that takes all my rows and separate them into multiple sheets in the same document. Here's exactly what i'm looking for:

- something that keeps my formating and cell width.
- something that would give the name of the first ell in each row to the new sheets (every row begins by a unique code)
- something that will copy the headers for every new sheets

As I said, every row begins by a different code. The table is called Leases and here's the data reference including headers : A1:AY201

I'm using Excel 2007 by the way.

thank you all,



Example :

Store No.LocationFran/Corp/Sub...
3P*** - Street LevelCorp...
3.1P*** - Mezzanine LevelCorp...

<tbody>
</tbody>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
That website doesn't work for me. Company is blocking it. Can't you post me the VBA code?

Also, I can't download anything to help me do it.

Thanks,
 
Upvote 0
Shame you cannot access this site from work ...
You could try to access it from elsewhere ...
If this project is important enough for you, you can construct your own program.

Let me recap the principles you need to apply to build the solution to your problem :
1. Test and learn the advanced filter capabilities
2. Turn on the macro recorder to visualise the VBA code
3. Improve on this basic code to reach your final solution

HTH
 
Upvote 0
Considering my VBA knowledge, it wouldn't help me much to only have something that i'll have to modify and to develop myself.

Isn't there anything already existing?

Thanks,
 
Upvote 0
I have some VBA code that works perfect for the ROWS but not the columns, maybe easy to adjust this?

Code:
Sub Splitbook()
MyPath = ThisWorkbook.Path
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues
ActiveSheet.Cells.PasteSpecial Paste:=xlPasteFormats
ActiveWorkbook.SaveAs _
Filename:=MyPath & "\" & sht.Name & "choose-name" & ".xlsx"
ActiveWorkbook.Close savechanges:=False
Next sht
End Sub

Hope this helps you further...
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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