ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy to wildcard (https://www.excelbanter.com/excel-programming/299088-re-copy-wildcard.html)

Chris

Copy to wildcard
 
those look more like workbook names not sheet names but i'm going by what you said
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.("summary_" & Mnth &".xls"). Range(Cells(1,1), Cells(x,LstClmn)) =
Sheets("052107.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

chris: Correction

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

richard

Claification
 
Sorry for the confusion..
Data copied from [052107.xls.]Summary! to [summary_may]Summary
Richard


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com