Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Transpose Microsoft Query

I need to transpose some data that I bring in via a microsoft query, however
when I do the copy and special paste it works properly the first time,
whenever i update the query, the transposed special paste goes back to the
orginal format. Is there anyway to do this?

Terry
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Transpose Microsoft Query

hi
how are you updating the query now? how big is it? were are you transposing
it?
a tad short on details but you might try something like this code.

Sub TransposeMSQ()
Sheets("Sheet1").Activate
Range("A1").QueryTable.Refresh BackgroundQuery = False
Range("A1:A50").Copy
Range("L1").PasteSpecial Paste:=xlPasteAll, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub

you might need to adjust the ranges to fit your data. the code can be
improved on if i have more details. right now i can only give vaque
possiblities.
you could run the code from macros are attach it to a command button on the
sheet.

regards
FSt1

"tmacdonald" wrote:

I need to transpose some data that I bring in via a microsoft query, however
when I do the copy and special paste it works properly the first time,
whenever i update the query, the transposed special paste goes back to the
orginal format. Is there anyway to do this?

Terry

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Transpose Microsoft Query

The query automatically updates based upon 2 parameters, (start date) & (end
date), the query brings in 4 rows normally each day, however there is a
possibility for additional rows (1 to 4 more rows) to be added without any
advanced notification. The query is designed to pull in 1 months worth of
data, however if need be the data can be expanded to more than 1 month of
less than a month.

There are 4 rows normally and 59 columns. I have tried your code an it
works, however it is copying some of the data before it is transposed and is
placing it below the transposed data, is there anyway to correct this?

Any further assistance would be greatly welcomed

Terry

"FSt1" wrote:

hi
how are you updating the query now? how big is it? were are you transposing
it?
a tad short on details but you might try something like this code.

Sub TransposeMSQ()
Sheets("Sheet1").Activate
Range("A1").QueryTable.Refresh BackgroundQuery = False
Range("A1:A50").Copy
Range("L1").PasteSpecial Paste:=xlPasteAll, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub

you might need to adjust the ranges to fit your data. the code can be
improved on if i have more details. right now i can only give vaque
possiblities.
you could run the code from macros are attach it to a command button on the
sheet.

regards
FSt1

"tmacdonald" wrote:

I need to transpose some data that I bring in via a microsoft query, however
when I do the copy and special paste it works properly the first time,
whenever i update the query, the transposed special paste goes back to the
orginal format. Is there anyway to do this?

Terry

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
Query from microsoft query- Excel 2007 טבלאות אקסל 2007 Excel Discussion (Misc queries) 0 December 24th 07 10:47 PM
Microsoft Query The Rook[_2_] Excel Discussion (Misc queries) 0 July 27th 07 01:44 PM
Microsoft Query Kay Excel Discussion (Misc queries) 0 October 18th 06 07:11 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
Microsoft Query Excel GuRu Excel Discussion (Misc queries) 4 January 19th 05 07:07 PM


All times are GMT +1. The time now is 07:58 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"