![]() |
Macro programming for Creating New Sheets and Copying Data
I have a peculiar problem:
I have a data in one excel sheet which I would like to transfer to another excel sheet. The data in the original file (say F1) is in one single sheet and what I want is to copy this data into a new file (say F2) and that too in different worksheets based on a value in one column of F1. For Example: F1 has sheet 1 only with data in 8 columns and say about 500 rows.like Headers a KD LT LD NW HO SE TIME Data1 .................................................. ................1:1.................. The colum SE has data from 1:1 to 1:40 Now the what I need to do is create a new xls file F2 where a macro looks for a sheet name 1-1 if its there then copies all the rows with 1:1 to that sheet ...if the sheet is not there then tht macro shud create that sheet named 1-1 and so on. I need a macro for this as this data change every hour and there a 9 files in which there is data and so I need to create like 360 new work sheets with 1-1 to 1-40 , 2-1 to 2-40,...9-1 to 9-40. I hope some can help me out with this |
Macro programming for Creating New Sheets and Copying Data
Start with the code at this site:
Modify it to check if the sheet exists before creating it. http://www.rondebruin.nl/copy5.htm -- Regards, Tom Ogilvy "Addy" wrote: I have a peculiar problem: I have a data in one excel sheet which I would like to transfer to another excel sheet. The data in the original file (say F1) is in one single sheet and what I want is to copy this data into a new file (say F2) and that too in different worksheets based on a value in one column of F1. For Example: F1 has sheet 1 only with data in 8 columns and say about 500 rows.like Headers a KD LT LD NW HO SE TIME Data1 .................................................. ...............1:1.................. The colum SE has data from 1:1 to 1:40 Now the what I need to do is create a new xls file F2 where a macro looks for a sheet name 1-1 if its there then copies all the rows with 1:1 to that sheet ...if the sheet is not there then tht macro shud create that sheet named 1-1 and so on. I need a macro for this as this data change every hour and there a 9 files in which there is data and so I need to create like 360 new work sheets with 1-1 to 1-40 , 2-1 to 2-40,...9-1 to 9-40. I hope some can help me out with this |
All times are GMT +1. The time now is 05:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com