Anybody can help? Urgent....Please help.... thanks!

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
Hi,

I am a new beginner in visual basic and I need to finish a project on time.

I have been trying to search for information as to how to use macro to open,copy paste and rename files.

The problem that I have for the files is how to set macro to compare the dates on files received (as each file name has different name but same date) and save all the files under one workbook with the name of the workbook set only to that particular date.

Could someone help me on this?

Thanks

Mic
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi!

I think that we all have to finish projects on time...

Perhaps if you posted your code so far it would help us to understand what you are trying to do.

This will take you to the top of the board anyway.
 
Upvote 0
hi,

the code that I have using macro recorder as below:

Sub Macro1()
Workbooks.Open
ActiveWorkbook.SaveAs Filename:=" ", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Save
Workbooks.Open Filename:=" "
Columns(":").Select
Selection.Copy
Windows(" ").Activate
Columns(":").Select
ActiveSheet.Paste
Windows(" ").Activate
ActiveWindow.Close
Workbooks.Open Filename:=" "
Application.CutCopyMode = False
ActiveWorkbook.Save

Windows("").Activate
ActiveWindow.Close
ActiveWindow.Close
End Sub

I leave the "" blank as I would like to have it checked on the date automatically. How should I:
1. set the program to check date
2. add all the worksheets into one workbook
3. rename the workbook under the same name?

Bearing in mind that the file name is in dates and it changes everyday.

Thanks
 
Upvote 0
Maybe I forgot to mention.

I need to copy selected range of cells from worksheets to a workbook. The worksheet I want to copy the whole file, rename it as the worksheet name (it's in date form).

For the subsequent worksheets, I want to copy from the second range onwards, paste to the centralised workbook and save as the same name.

The next day when the date change the same macro will automatically triggers and run the same function.

Can anyone help me with this? Thanks very much for your help! :wink:
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top