Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
I am writing a Visual Basic.Net 2005 desktop application that exports data to
individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
'1. Column headers use a loop to update the header columns. Write this as a
separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
"Jacob Skaria":
Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
I understand you want to populate Column header and Page header in the top
rows. You can have these information populated into the cells and then use the below code to repeat this section in all pages. ActiveSheet.PageSetup.PrintTitleRows = "$1:$3" If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: "Jacob Skaria": Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
"Jacob Skaria":
Thank you for your answer but I still have the following questions: 1. Doesn't the code 'ActiveSheet.PageSetup.PrintTitleRows = "$1:$3"' copy the header information into more worksheets in the same workbook? i am asking that question since this code referst to the active sheet. Does this work for copying the header lines into different workbooks? If not, how do you copy the header information into individual worksheets in separate workbook? (I am going to generate one worksheet per workbook since the reports go to different customers. 2. How you you populate the column and page headers where there is one worksheet per workbook? "Jacob Skaria" wrote: I understand you want to populate Column header and Page header in the top rows. You can have these information populated into the cells and then use the below code to repeat this section in all pages. ActiveSheet.PageSetup.PrintTitleRows = "$1:$3" If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: "Jacob Skaria": Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
Jacob Skaria":
Thank you for your answer but I still have the following questions: 1. Doesn't the code 'ActiveSheet.PageSetup.PrintTitleRows = "$1:$3"' copy the header information into more worksheets in the same workbook? i am asking that question since this code referst to the active sheet. Does this work for copying the header lines into different workbooks? If not, how do you copy the header information into individual worksheets in separate workbook? (I am going to generate one worksheet per workbook since the reports go to different customers. 2. How you you populate the column and page headers where there is one worksheet per workbook? "Jacob Skaria" wrote: "Jacob Skaria" wrote: I understand you want to populate Column header and Page header in the top rows. You can have these information populated into the cells and then use the below code to repeat this section in all pages. ActiveSheet.PageSetup.PrintTitleRows = "$1:$3" If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: "Jacob Skaria": Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
1. You will have to apply this for each workbook. The process would be
something like this..Open new workbook..Populate page header information in cells/ then the column header information.........and then populate the data...Save As....If the data is same you can make changes to the Workbook and change the fields...to suit the next and again SaveAs....until close...I know this is only on a highlevel...Please let me know about the information....Is that going to be same in all workbooks with header info changes...or ??? If you set the title rows; that can be viewed in excel only once.. but if the user print or print preview the title rows will be populated in all rows.. 2. Column and header info has to be populated into the cells just below the page header cells...Unlike other reporting tools we dont have cells i mean rows available in excel to populate the page header or column header....So we will use the first 3 rows as the page header ..and the corresponding row as the column header....If the column header remains the same then it is better to include column header along with page header with a different color tone or font size.. Again this depends on your requirement. Do you have sub headers or sub totals in your data.... In case of any queries please post back. I will be checking this...Thanks If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: Jacob Skaria": Thank you for your answer but I still have the following questions: 1. Doesn't the code 'ActiveSheet.PageSetup.PrintTitleRows = "$1:$3"' copy the header information into more worksheets in the same workbook? i am asking that question since this code referst to the active sheet. Does this work for copying the header lines into different workbooks? If not, how do you copy the header information into individual worksheets in separate workbook? (I am going to generate one worksheet per workbook since the reports go to different customers. 2. How you you populate the column and page headers where there is one worksheet per workbook? "Jacob Skaria" wrote: "Jacob Skaria" wrote: I understand you want to populate Column header and Page header in the top rows. You can have these information populated into the cells and then use the below code to repeat this section in all pages. ActiveSheet.PageSetup.PrintTitleRows = "$1:$3" If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: "Jacob Skaria": Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
.net data being formatted in excel
"Jacob Skaria":
This is to answer your question about the detail on the excel spreadsheets: 1. The title of the report will be the same between all the reports. 2. The subcategory header will be the same format, however the data will change based upon the customer information. 3. The column titles will be different depending upon what rows of the joined tables the particular customer wants to see. 4. There is no summary or total information. Thanks for showing me how you would code this between vn.net 2005 desktop application exporting the sql server data to one worksheet in a workbook. (Each workbook is for individual customers.) "Jacob Skaria" wrote: 1. You will have to apply this for each workbook. The process would be something like this..Open new workbook..Populate page header information in cells/ then the column header information.........and then populate the data...Save As....If the data is same you can make changes to the Workbook and change the fields...to suit the next and again SaveAs....until close...I know this is only on a highlevel...Please let me know about the information....Is that going to be same in all workbooks with header info changes...or ??? If you set the title rows; that can be viewed in excel only once.. but if the user print or print preview the title rows will be populated in all rows.. 2. Column and header info has to be populated into the cells just below the page header cells...Unlike other reporting tools we dont have cells i mean rows available in excel to populate the page header or column header....So we will use the first 3 rows as the page header ..and the corresponding row as the column header....If the column header remains the same then it is better to include column header along with page header with a different color tone or font size.. Again this depends on your requirement. Do you have sub headers or sub totals in your data.... In case of any queries please post back. I will be checking this...Thanks If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: Jacob Skaria": Thank you for your answer but I still have the following questions: 1. Doesn't the code 'ActiveSheet.PageSetup.PrintTitleRows = "$1:$3"' copy the header information into more worksheets in the same workbook? i am asking that question since this code referst to the active sheet. Does this work for copying the header lines into different workbooks? If not, how do you copy the header information into individual worksheets in separate workbook? (I am going to generate one worksheet per workbook since the reports go to different customers. 2. How you you populate the column and page headers where there is one worksheet per workbook? "Jacob Skaria" wrote: "Jacob Skaria" wrote: I understand you want to populate Column header and Page header in the top rows. You can have these information populated into the cells and then use the below code to repeat this section in all pages. ActiveSheet.PageSetup.PrintTitleRows = "$1:$3" If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: "Jacob Skaria": Your reply answers part of my question, thanks! 1. I do not understand your reply for column headers. can you tell me how the following code actually accesses the column headers: For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next 2. Can you tell me how to put page headers in rows 1 to 3 for each new worksheet that is created? Thanks! "Jacob Skaria" wrote: '1. Column headers use a loop to update the header columns. Write this as a separate procedure and call it for each workbook For lngCol = 1 to Ubound(arrHeader) Workbook.Sheets("Sheet1").Cells(1,lngCol) = arrHeader(lngCol) Next '2. Wrap text. Select the column you need Workbook.Sheets("Sheet1").Columns("E:E").Select Selection.WrapText = True If this post helps click Yes --------------- Jacob Skaria "douglas" wrote: I am writing a Visual Basic.Net 2005 desktop application that exports data to individual excel 2003 spreadsheets in separate workbooks. (The data is written to separate workbooks since the workbooks are emailed to different customers.) I am exporting all the data I want to the spreadsheets now. However, I would like to know how to do any of the following: 1. Put the column headers on to the top of each data column. 2. How to put report headers on the first 3 rows of each spreadsheet, 3. How to set the wraparound property one column in particular. I have one column that is varchar(500) and I want this column to wraparound. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CONVERTING MS WORD FORMATTED DATA INTO EXCEL WORKSHEET | Excel Discussion (Misc queries) | |||
How can i get formatted data from outlook to excel? | Excel Worksheet Functions | |||
Copied data auto-formatted in Excel | Excel Discussion (Misc queries) | |||
Can Excel be pre-formatted to apply "double quotes" to data enter. | Excel Worksheet Functions | |||
REQ: Simplest way to parse (read) HTML formatted data in via Excel VBA (or VB6) | Excel Programming |