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
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
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
 

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
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:
 

Watch MrExcel Video

Forum statistics

Threads
1,122,207
Messages
5,594,841
Members
413,944
Latest member
3xc3ln00b

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
Top