View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Sheeloo[_4_] Sheeloo[_4_] is offline
external usenet poster
 
Posts: 225
Default macro which copies data from a 2nd WB, The WB has a new name each

wbName = Format(Date, "mmm-dd") & ".xls"
will give you the workbookname in the vairable wbName

Try this to get the value in A1 from Mar-28.xls (if run today) Sheet1 A1
into the current worksheet A1
Sub getValue()
wbname = Format(Date, "mmm-dd") & ".xls"
ThisWorkbook.ActiveSheet.Cells(1, 1) =
Workbooks(wbname).Worksheets("Sheet1").Cells(1, 1)
End Sub

"Dick (Learning To Write Macros)" wrote:

I would like to write a marco in one Workbook (Master.xls), which copies data
from cells in another open Workbook (Data March-28.xls). This second
Workbook changes it's name each day to: Data March-29.xls, Data March-30.xls,
etc.

Thanx For Your Help