Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicating macros


This is the code for my macro:

Windows("dump.xls").Activate
Cells.Replace What:="$", Replacement:="", LookAt:=xlPart
SearchOrder:= _
xlByRows, MatchCase:=False
Cells.Select
ActiveWindow.Zoom = 75
Columns("A:A").Select
Selection.Copy
Windows("New_format_PL_101103_test.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Windows("dump.xls").Activate
Columns("B:D").Select
Application.CutCopyMode = False
Selection.Copy
Windows("New_format_PL_101103_test.xls").Activate
Range("C1").Select
ActiveSheet.Paste
Windows("dump.xls").Activate

As you can see, it copies information from one page and pastes it int
another. my problem is, how can I replicate this macro without havin
the names of the files in there. I plan to make a new document b
copying new_format_pl_101103.xls everyday, and renaming it, so today
this document is called new_format_pl_111103.xls. I don't want to hav
to go into the code everyday so that my macro can be run.

Please help me. Thanks

Sheeta

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default duplicating macros

Hi Sheetal

Sub test()
Dim Dayfile As String
Dayfile = "New_format_pl_" & _
Format(Date, "ddmmyy") & ".xls"
MsgBox Dayfile
End Sub

As you hopefully know; To use a string variable as that, do not put quotes around it:
Windows(Dayfile)
NOT
Windows("Dayfile")

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Sheetal" wrote in message
...

This is the code for my macro:

Windows("dump.xls").Activate
Cells.Replace What:="$", Replacement:="", LookAt:=xlPart,
SearchOrder:= _
xlByRows, MatchCase:=False
Cells.Select
ActiveWindow.Zoom = 75
Columns("A:A").Select
Selection.Copy
Windows("New_format_PL_101103_test.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Windows("dump.xls").Activate
Columns("B:D").Select
Application.CutCopyMode = False
Selection.Copy
Windows("New_format_PL_101103_test.xls").Activate
Range("C1").Select
ActiveSheet.Paste
Windows("dump.xls").Activate

As you can see, it copies information from one page and pastes it into
another. my problem is, how can I replicate this macro without having
the names of the files in there. I plan to make a new document by
copying new_format_pl_101103.xls everyday, and renaming it, so today,
this document is called new_format_pl_111103.xls. I don't want to have
to go into the code everyday so that my macro can be run.

Please help me. Thanks

Sheetal


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicating macros


I put the command you gave me into my code, and took out the quotatio
marks, but my code is still coming up with errors. The dates that I a
working with, are 1 day behind. how can i sort this out?

Thank you so much for your hel

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default duplicating macros

What errors ? What do they say ?

For yesterday:
Format(Date - 1, "ddmmyy")

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Sheetal" skrev i melding
...

I put the command you gave me into my code, and took out the quotation
marks, but my code is still coming up with errors. The dates that I am
working with, are 1 day behind. how can i sort this out?

Thank you so much for your help


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default duplicating macros


The errors were just runtime errors, but I have fixed them now. Than
so much for your help!!

Regards,
Sheeta

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
duplicating rows Patty Excel Discussion (Misc queries) 1 May 10th 10 07:26 PM
Duplicating Folders [email protected] Links and Linking in Excel 3 May 30th 08 11:37 PM
duplicating worsheets Don Excel Worksheet Functions 2 November 28th 06 07:11 PM
De-duplicating Peter Excel Discussion (Misc queries) 1 August 4th 05 05:32 PM
duplicating worksheets Ralph2 Excel Discussion (Misc queries) 1 January 20th 05 05:05 AM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"