Search : in
By :

Find copy and create new excel files w macro

Last answer on Nov 8, 2009 10:28:02 pm GMT hero85, on Mar 13, 2009 1:33:46 pm GMT 
 Report this message to moderators

Hello,
I would like to create a macro to save time. I receive data which I then have to process in excel.
Right now, I need help with copying and paste the data into new excel files automatically.
The data I receive is always like this:
--Start test--
45
34
23
454
232
--End Test--
--Start test--
99
33
22
--End Test--

So in this example, I received a file which had two tests in it that means two different files should be created. So I need to copy everything in between start test and end test. And then paste it into a new excel file.
Any links or any type of help will be appreciated.

Configuration: Windows XP
Internet Explorer 6.0

Best answers for « Find copy and create new excel files w macro » in :
Creating an empty file ShowCreating an empty file To create an empty file, type the following command: > file You can also use the touch command: touch file
How to create a PPS file ? ShowHow to create a PPS file? A PPS file is a presentation (PPT extension) that the extension has been amended so that it can be opened independently. To create a PP
Creating an Autorun.inf file ShowCreating an Autorun file Allowing autorun Creating an Autorun.inf file Variations Customizing the icon Customizing the icon text Customizing the icon menu Allowing autorun Windows provide users with simple utility that runs...
Download LC ISO Creator ShowLC ISO Creator is very simple: it allows to create a .ISO file from your CD. Then, it allows you to burn these ISO files, to use CD emulation software (in order not to use any more the original CD) or to make a backup copy. The software is...
Spreadsheets - The Excel Interface ShowExcel Introduction Microsoft Excel is the spreadsheet in the Microsoft Office office suite. To start it, simply click on the appropriate icon in the Start menu (in Windows) or click on an Excel file (that has an .xls file extension). A Excel...

1

WutUp WutUp, on Mar 15, 2009 2:20:15 am GMT
  • +1

This code assumes that the data is in column A and there are no empty rows from the start to the end of the data. Also, the data is copied from Sheet2 to Sheet1 and the rows to copy start in row one and will be copied to row one.


Sub CopyToNewSheet()

Set o = Sheets("Sheet1") 'Where the data is copied to. You can rename it to your sheet name.
Set t = Sheets("Sheet2") 'Where the data resides. You can rename it to your sheet name.
Dim CpyData
Dim d
CpyData = 0
d = 1


Do While Not IsEmpty(t.Range("A" & d))

If IsNumeric(t.Range("A" & d)) Then
CpyData = CpyData + 1

o.Range("A" & CpyData) = t.Range("A" & d)

End If

d = d + 1

Loop

End Sub

Reply to WutUp WutUp

3

 reddishpink, on Nov 8, 2009 10:28:02 pm GMT

Hello ive a similar problem here.. im a newbie to VBA Script so i kinda dont have much clue of what should i do and stuff.
my case is a bit similar.. what happens when say i have 365 files (one file per day, through out the whole yr).. each file when opened in excel has 23 columns.. the only columns that i want to use is column A(minute) and column X(Solar Radiation)..

How do i import these 2 columns from each files , and have them in just one sheet, so that i only have :

in column A - minute
column B to colum ZZ - day 1 to day 365

and using macros.

Thanks!!

Reply to reddishpink

2

hero85, on Mar 17, 2009 9:22:07 pm GMT
  • +2

Ok, I will try this code soon. I hope it works. Also is there not a way to copy from one file to another? I don't want to transfer to a sheet but to a file!

Reply to hero85