VB Column Width and Sheet Name

Closed
Report
Posts
2
Registration date
Wednesday June 5, 2013
Status
Member
Last seen
June 5, 2013
-
Posts
2
Registration date
Wednesday June 5, 2013
Status
Member
Last seen
June 5, 2013
-
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/faq/7053-excel-macro-to-create-new-workbook-and-copy-data

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 replies


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
Posts
2
Registration date
Wednesday June 5, 2013
Status
Member
Last seen
June 5, 2013

Thanks, this helped get me sorted out!
0