VB Column Width and Sheet Name

Closed
hsolo30k Posts 2 Registration date Wednesday June 5, 2013 Status Member Last seen June 5, 2013 - Jun 5, 2013 at 01:19 PM
hsolo30k Posts 2 Registration date Wednesday June 5, 2013 Status Member Last seen June 5, 2013 - Jun 5, 2013 at 05:13 PM
Hi,
I am really new to VB, but I work a ton with Excel. I have a spreadsheet that I have to parse out into multiple spreadsheets for some reporting purposes.
I found this article which helped, with a modification of the column that the data was stored in:
https://ccm.net/apps-sites/software/9399-use-a-macro-to-create-new-workbook-and-copy-data-in-excel/

It works great for creating multiple spreadsheets from the master.
I have 2 question though-
1. Is it possible to set the column width in the new workbooks? All the data shows up from the master, but I need the columns to be wider, and haven't been able to figure out how to achieve this while the sheets are being created.
2. Can I name the new worksheet created in the new workbooks something other that Sheet 1?
Sorry if these are dumb questions, but VB is not my thing.
Thanks!

2 responses

Blocked Profile
Jun 5, 2013 at 02:59 PM
Good Afternoon.

I hope this is what you were looking for...this is the first problem.

This is the VBA code and not a formula.


=Columns("B:B").EntireColumn.AutoFit

The second Answer....

is something like .....
Sheets(1).Name = "thenewname"

Once again , through VBA and not a formua.
1
hsolo30k Posts 2 Registration date Wednesday June 5, 2013 Status Member Last seen June 5, 2013
Jun 5, 2013 at 05:13 PM
Thanks, this helped get me sorted out!
0