Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Transpose to different sheet

Sorry for the cross-posting, but I'm not sure where this is better placed.

I need to take the data from an Access table and turn it into column headers
in an Excel spreadsheet.

I can easily export the data to a spreadsheet (call it sheet A), but it
appears as a column.

I then need to determine how many entries there are in the column, insert
that number of columns in another spreadsheet in a different workbook (call
it sheet B) and transpose the column in sheet A to populate row 1 in sheet
B.
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access
external usenet poster
 
Posts: 5,441
Default Transpose to different sheet

I have no idea how to count items from an Access table, but for the Excel Part

A lot depends on what objects you have defined:
With oExcel
With oXLWkBk
With oXLWkSht

Lets's assume you have oExcel defined as the Excel Application, and have SheetA as an object:
oXLWkShtA, and the data appears in column A of that sheet. Lets's also assume you have SheetB as an
object: oXLWkShtB.

Set oXLWkShtA = oExcel.Workbooks("Book1.xls").Worksheets("SheetA")
Set oXLWkShtB = oExcel.Workbooks("Book2.xls").Worksheets("SheetB")
myCount = oXLWkShtA.Range("A:A").SpecialCells(xlCellTypeCons tants).Cells.Count
oXLWkShtB.Range("A:A").Resize(1, myCount).EntireColumn.Insert
oXLWkShtA.Range("A:A").SpecialCells(xlCellTypeCons tants).Cells.Copy
oXLWkShtB.Range("A1").PasteSpecial Transpose:=True


HTH,
Bernie
MS Excel MVP


"Ian" wrote in message ...
Sorry for the cross-posting, but I'm not sure where this is better placed.

I need to take the data from an Access table and turn it into column headers in an Excel
spreadsheet.

I can easily export the data to a spreadsheet (call it sheet A), but it appears as a column.

I then need to determine how many entries there are in the column, insert that number of columns
in another spreadsheet in a different workbook (call it sheet B) and transpose the column in sheet
A to populate row 1 in sheet B.

My question is, is there an easier way to do this, perhaps by determining the number of entries in
the table and exporting this directly into the spreadsheet row?

Failing that, I know how to determine how many rows are used in sheet A, but how do I transpose it
to sheet B?

This is all to be done using Access VBA.

Hope you can help.

--
Ian
--




  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Transpose to different sheet

Thanks, Bernie.

That sounds promising, but I don't have the time to look at it in detail
just now. It'll have to wait for another day.

I don't know how to count the number of entries in an Access table either,
but your code seems to do the job once it's in Excel.

--
Ian
--
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
I have no idea how to count items from an Access table, but for the Excel
Part

A lot depends on what objects you have defined:
With oExcel
With oXLWkBk
With oXLWkSht

Lets's assume you have oExcel defined as the Excel Application, and have
SheetA as an object: oXLWkShtA, and the data appears in column A of that
sheet. Lets's also assume you have SheetB as an object: oXLWkShtB.

Set oXLWkShtA = oExcel.Workbooks("Book1.xls").Worksheets("SheetA")
Set oXLWkShtB = oExcel.Workbooks("Book2.xls").Worksheets("SheetB")
myCount =
oXLWkShtA.Range("A:A").SpecialCells(xlCellTypeCons tants).Cells.Count
oXLWkShtB.Range("A:A").Resize(1, myCount).EntireColumn.Insert
oXLWkShtA.Range("A:A").SpecialCells(xlCellTypeCons tants).Cells.Copy
oXLWkShtB.Range("A1").PasteSpecial Transpose:=True


HTH,
Bernie
MS Excel MVP


"Ian" wrote in message
...
Sorry for the cross-posting, but I'm not sure where this is better
placed.

I need to take the data from an Access table and turn it into column
headers in an Excel spreadsheet.

I can easily export the data to a spreadsheet (call it sheet A), but it
appears as a column.

I then need to determine how many entries there are in the column, insert
that number of columns in another spreadsheet in a different workbook
(call it sheet B) and transpose the column in sheet A to populate row 1
in sheet B.

My question is, is there an easier way to do this, perhaps by determining
the number of entries in the table and exporting this directly into the
spreadsheet row?

Failing that, I know how to determine how many rows are used in sheet A,
but how do I transpose it to sheet B?

This is all to be done using Access VBA.

Hope you can help.

--
Ian
--






  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access
external usenet poster
 
Posts: 9,101
Default Transpose to different sheet

I would go the other way. Don't export from access, instead import from
excel. Record a new macro in excel, then go to data - import external data -
new database query.

I it esier to read tables in excel then in access. Once to get your macro
post the results and we can give you futher assistance.

"Ian" wrote:

Sorry for the cross-posting, but I'm not sure where this is better placed.

I need to take the data from an Access table and turn it into column headers
in an Excel spreadsheet.

I can easily export the data to a spreadsheet (call it sheet A), but it
appears as a column.

I then need to determine how many entries there are in the column, insert
that number of columns in another spreadsheet in a different workbook (call
it sheet B) and transpose the column in sheet A to populate row 1 in sheet
B.

My question is, is there an easier way to do this, perhaps by determining
the number of entries in the table and exporting this directly into the
spreadsheet row?

Failing that, I know how to determine how many rows are used in sheet A, but
how do I transpose it to sheet B?

This is all to be done using Access VBA.

Hope you can help.

--
Ian
--



  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Transpose to different sheet

Thanks, Joel.

I'm much more familiar with Excel than Access and I have already done most
of the work towards formatting the data and the calculations required in the
resulting spreadsheet. I will bear your suggestions in mind if I don't get
anywhere with Bernie's suggestion.

--
Ian
--
"Joel" wrote in message
...
I would go the other way. Don't export from access, instead import from
excel. Record a new macro in excel, then go to data - import external
data -
new database query.

I it esier to read tables in excel then in access. Once to get your macro
post the results and we can give you futher assistance.

"Ian" wrote:

Sorry for the cross-posting, but I'm not sure where this is better
placed.

I need to take the data from an Access table and turn it into column
headers
in an Excel spreadsheet.

I can easily export the data to a spreadsheet (call it sheet A), but it
appears as a column.

I then need to determine how many entries there are in the column, insert
that number of columns in another spreadsheet in a different workbook
(call
it sheet B) and transpose the column in sheet A to populate row 1 in
sheet
B.

My question is, is there an easier way to do this, perhaps by determining
the number of entries in the table and exporting this directly into the
spreadsheet row?

Failing that, I know how to determine how many rows are used in sheet A,
but
how do I transpose it to sheet B?

This is all to be done using Access VBA.

Hope you can help.

--
Ian
--







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I transpose items from another sheet? Katie Excel Discussion (Misc queries) 4 September 1st 09 08:01 PM
how do i transpose a Polynomial equation from a graph to a sheet? All at Sea Excel Discussion (Misc queries) 2 March 16th 08 06:40 AM
Transpose from one sheet to the next and leave out blank cells notso Excel Discussion (Misc queries) 2 January 31st 07 01:42 AM
Filling a listbox with transpose of a range from an excel sheet viswanthank Excel Programming 2 June 9th 05 03:37 PM
Excel VBA - How to transpose every fifth row to same column on another sheet rbelforti Excel Programming 2 July 7th 04 06:22 PM


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"