View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
chris: Correction chris: Correction is offline
external usenet poster
 
Posts: 4
Default Copy to wildcard


Sub CopyData(
LstClmn = Sheets("052107.xls").UsedRange.Offset
(0, ActiveSheet.UsedRange.Columns.Count - 1).
Resize(, 1).Colum
x = YourRowCoun
Mnth =Cstr( Format(Now,"mmm")) '<< assuming you use three letter abbreviation for each month
Sheets("052107.xls").Range(Cells(1,1), Cells(x,LstClmn)).Copy Destination:=
Sheets.("summary_" & Mnth &".xls"). Range(Cells(1,1), Cells(x,LstClmn))
End Su



----- Richard wrote: ----

Greetings
I am copying data from a daily worksheet (052107.xls) to a monthly summary (summary_may.xls), the data on the daily sheets will have the same number of rows but different numbers of columns. How can I copy the used range on the daily summary sheet to the monthly sheet
Thanks
Richard