Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default copy and paste

i currently use Excel 2003 and have a copy and paste query.

i have a spreadsheet called "Orders Wk1" that has tabs for each day of the week and each tab has several column headings i.e Customer 1, Customer 2, Customer 3 etc.
I would like a macro that identifies a particular column heading (i.e Customer 2) and then copies the contents of that single column into a separate spreadsheet called "Order Summary"; this needs to be done for each day of the week.
The idea is to build up a history of daily orders for Customer 2.

Also. each time the macro is activated the data needs to be copied into the "Order Summary" in the next available column.

The "Order Summary" spreadsheet will be used all the time but the Orders spreadsheet will change each week i.e "Order Wk1", "Orders Wk2" etc.

TIA for all your help




--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copy and paste

I think you want something like this. I assumed the Order Summary sheet
already existed.

Sub MakeSummary()

Customer = "Me"
With Sheets("Order Summary")
LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column
NewCol = LastCol + 1
End With
'repeat for each sheet except Order Summary Sheet
For Each sht In ThisWorkbook.Sheets
If sht.Name < "Order Summary" Then
'Find customer in Row 1
Set c = sht.Rows(1).Find(what:=Customer, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
MsgBox ("Cound not find customer : " & Customer & _
"in Sheet : " & sht.Name)
Else
c.EntireColumn.Copy _
Destination:=Sheets("Order Summary").Columns(NewCol)
NewCol = NewCol + 1
End If
End If
Next sht

End Sub

"MickkyB" wrote:

i currently use Excel 2003 and have a copy and paste query.

i have a spreadsheet called "Orders Wk1" that has tabs for each day of the week and each tab has several column headings i.e Customer 1, Customer 2, Customer 3 etc.
I would like a macro that identifies a particular column heading (i.e Customer 2) and then copies the contents of that single column into a separate spreadsheet called "Order Summary"; this needs to be done for each day of the week.
The idea is to build up a history of daily orders for Customer 2.

Also. each time the macro is activated the data needs to be copied into the "Order Summary" in the next available column.

The "Order Summary" spreadsheet will be used all the time but the Orders spreadsheet will change each week i.e "Order Wk1", "Orders Wk2" etc.

TIA for all your help




--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-


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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Automating copy/paste/paste special when row references change Carl LaFong Excel Programming 4 October 8th 07 06:10 AM
help w/ generic copy & paste/paste special routine DavidH[_2_] Excel Programming 5 January 23rd 06 03:58 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


All times are GMT +1. The time now is 08:45 PM.

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

About Us

"It's about Microsoft Excel"