By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

Automating formatting of Excel

P: n/a
Can anyone help me?

I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
Also if possible I would like to subtotal the data on the worksheet.

I can do all this in VBA but for the life of me can't do it in VB, please help.
--
All advice greatfully received
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "=?Utf-8?B?QmFncHVzcw==?=" <Ba*****@discussions.microsoft.com> scripsit:
I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
Also if possible I would like to subtotal the data on the worksheet.

I can do all this in VBA but for the life of me can't do it in VB, please help.


I doubt that there is a big difference between how to do that in VBA and
via Excel automation. How would you have done it in VBA?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Thanks for the quick response.

My VBA code looks lik this;

Sheets("Sheet1").Select
Selection.Subtotal GroupBy:=4, Function:=xlSum, TotalList:=Array(6, 7), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ActiveSheet.Outline.ShowLevels RowLevels:=2

How can I get VB to do this for me?
--
All advice greatfully received
"Herfried K. Wagner [MVP]" wrote:
* "=?Utf-8?B?QmFncHVzcw==?=" <Ba*****@discussions.microsoft.com> scripsit:
I am using VB.NET to output data to an Excel 2002 spreadsheet, this works fine.
I would like to know how to change the sheet names and output to a named worksheet and add/remove a named worksheet
Also if possible I would like to subtotal the data on the worksheet.

I can do all this in VBA but for the life of me can't do it in VB, please help.


I doubt that there is a big difference between how to do that in VBA and
via Excel automation. How would you have done it in VBA?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.